Skip to content

Commit d099e09

Browse files
Prepare repository for next release and SBT build improvements (#65)
1 parent 8180990 commit d099e09

23 files changed

+104
-125
lines changed

.scalafmt.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=2.4.2
1+
version=2.6.0
22
style = defaultWithAlign
33
maxColumn = 100
44

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ the code. Pull requests are also welcome.
1111

1212
People are expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md) when discussing _exercises-scalacheck_ on the Github page or other venues.
1313

14-
If you are being harassed, please contact one of [us](AUTHORS.md#maintainers) immediately so that we can support you. In case you cannot get in touch with us please write an email to [47 Degrees](mailto:scala-exercises@47deg.com).
14+
If you are being harassed, please contact one of [us](AUTHORS.md#maintainers) immediately so that we can support you. In case you cannot get in touch with us please write an email to [47 Degrees Open Source](mailto:hello@47deg.com).
1515

1616
## How can I help?
1717

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright (C) 2016-2020 47 Degrees <https://47deg.com>
189+
Copyright (C) 2016-2020 47 Degrees Open Source <https://www.47deg.com>
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

NOTICE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
exercises-scalacheck
66

7-
Copyright (c) 2016-2020 47 Degrees. All rights reserved.
7+
Copyright (c) 2016-2020 47 Degrees Open Source. All rights reserved.
88

99
Licensed under Apache-2.0. See [LICENSE](LICENSE.md) for terms.

build.sbt

+25-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
import com.jsuereth.sbtpgp.PgpKeys.publishSigned
22

3+
ThisBuild / organization := "org.scala-exercises"
4+
ThisBuild / githubOrganization := "47degrees"
5+
ThisBuild / scalaVersion := "2.13.2"
6+
7+
publish / skip := true
8+
9+
// This is required by the exercises compiler:
310
publishLocal := (publishLocal dependsOn compile).value
411
publishSigned := (publishSigned dependsOn compile).value
512

613
addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; test")
7-
addCommandAlias("ci-docs", "github; project-docs/mdoc; headerCreateAll")
14+
addCommandAlias("ci-docs", "github; documentation/mdoc; headerCreateAll")
15+
addCommandAlias("ci-publish", "github; ci-release")
816

917
lazy val exercises = (project in file("."))
10-
.settings(moduleName := "exercises-scalacheck")
11-
.settings(exercisesSettings)
18+
.settings(name := "exercises-scalacheck")
19+
.settings(
20+
libraryDependencies ++= Seq(
21+
"org.scala-exercises" %% "exercise-compiler" % "0.6.1",
22+
"org.scala-exercises" %% "definitions" % "0.6.1",
23+
"joda-time" % "joda-time" % "2.10.6",
24+
"com.47deg" %% "scalacheck-toolbox-datetime" % "0.3.5",
25+
"com.chuusai" %% "shapeless" % "2.3.3",
26+
"org.scalatest" %% "scalatest" % "3.1.2",
27+
"org.scalacheck" %% "scalacheck" % "1.14.3",
28+
"org.scalatestplus" %% "scalacheck-1-14" % "3.1.2.0",
29+
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % "1.2.5"
30+
)
31+
)
1232
.enablePlugins(ExerciseCompilerPlugin)
1333

14-
lazy val `project-docs` = (project in file(".docs"))
15-
.aggregate(exercises)
16-
.dependsOn(exercises)
17-
.settings(moduleName := "exercises-project-docs")
18-
.settings(mdocIn := file(".docs"))
34+
lazy val documentation = project
1935
.settings(mdocOut := file("."))
20-
.settings(skip in publish := true)
36+
.settings(publish / skip := true)
2137
.enablePlugins(MdocPlugin)

.docs/AUTHORS.md docs/AUTHORS.md

File renamed without changes.
File renamed without changes.
File renamed without changes.

.docs/LICENSE.md docs/LICENSE.md

File renamed without changes.

.docs/NOTICE.md docs/NOTICE.md

File renamed without changes.

project/ProjectPlugin.scala

-53
This file was deleted.

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.11
1+
sbt.version=1.3.12

project/plugins.sbt

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
resolvers += Resolver.sonatypeRepo("snapshots")
2-
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.0")
3-
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
4-
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.5")
5-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
6-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
7-
addSbtPlugin("com.alejandrohdezma" %% "sbt-github" % "0.8.0")
8-
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.0")
9-
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.0")
10-
addSbtPlugin("com.alejandrohdezma" % "sbt-mdoc-toc" % "0.2")
1+
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.1")
2+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
3+
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.5")
4+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
5+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
6+
addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.8.2")
7+
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.2")
8+
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.2")
9+
addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0")

src/main/scala/scalachecklib/ArbitrarySection.scala

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 47 Degrees <https://47deg.com>
2+
* Copyright 2016-2020 47 Degrees Open Source <https://www.47deg.com>
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,8 @@ package scalachecklib
1919
import org.scalatest.matchers.should.Matchers
2020
import org.scalatestplus.scalacheck.Checkers
2121

22-
/** ==The `arbitrary` Generator==
22+
/**
23+
* ==The `arbitrary` Generator==
2324
*
2425
* There is a special generator, `org.scalacheck.Arbitrary.arbitrary`, which generates arbitrary values of any
2526
* supported type.
@@ -48,7 +49,8 @@ object ArbitrarySection extends Checkers with Matchers with org.scalaexercises.d
4849

4950
import GeneratorsHelper._
5051

51-
/** Let's see an example where we're defining an `implicit` `arbitrary` instance for `Char`
52+
/**
53+
* Let's see an example where we're defining an `implicit` `arbitrary` instance for `Char`
5254
*/
5355
def implicitArbitraryChar(res0: Seq[Char]) = {
5456

@@ -63,7 +65,8 @@ object ArbitrarySection extends Checkers with Matchers with org.scalaexercises.d
6365
check(forAll { c: Char => validChars.contains(c) })
6466
}
6567

66-
/** This becomes more useful when we're dealing with our own data types.
68+
/**
69+
* This becomes more useful when we're dealing with our own data types.
6770
* We'll use the case class defined in the ''Generators Section'':
6871
*
6972
* {{{
@@ -89,7 +92,8 @@ object ArbitrarySection extends Checkers with Matchers with org.scalaexercises.d
8992
check(forAll { foo: Foo => (foo.intValue < 0) == res0 && !foo.charValue.isDigit })
9093
}
9194

92-
/** The `Arbitrary.arbitrary` method also returns a `Gen` object.
95+
/**
96+
* The `Arbitrary.arbitrary` method also returns a `Gen` object.
9397
*/
9498
def useArbitraryOnGen(res0: Int) = {
9599

src/main/scala/scalachecklib/GeneratorsHelper.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 47 Degrees <https://47deg.com>
2+
* Copyright 2016-2020 47 Degrees Open Source <https://www.47deg.com>
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/scala/scalachecklib/GeneratorsSection.scala

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 47 Degrees <https://47deg.com>
2+
* Copyright 2016-2020 47 Degrees Open Source <https://www.47deg.com>
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,14 +19,14 @@ package scalachecklib
1919
import org.scalatest.matchers.should.Matchers
2020
import org.scalatestplus.scalacheck.Checkers
2121

22-
/** Generators are responsible for generating test data in ScalaCheck, and are represented by the `org.scalacheck.Gen`
22+
/**
23+
* Generators are responsible for generating test data in ScalaCheck, and are represented by the `org.scalacheck.Gen`
2324
* class. ou need to know how to use this class if you want ScalaCheck to generate data of types that are not supported
2425
* by default, or if you want to use the `forAll` method mentioned above, to state properties about a specific subset of
2526
* a type. In the `Gen` object, there are several methods for creating new and modifying existing generators.
2627
* We will show how to use some of them in this section. For a more complete reference of what is available,
2728
* please see the API scaladoc.
2829
*
29-
*
3030
* A generator can be seen simply as a function that takes some generation parameters, and (maybe) returns a
3131
* generated value. That is, the type `Gen[T]` may be thought of as a function of type `Gen.Params => Option[T]`.
3232
* However, the `Gen` class contains additional methods to make it possible to map generators, use them in
@@ -42,7 +42,8 @@ object GeneratorsSection
4242

4343
import GeneratorsHelper._
4444

45-
/** Let's see how to create a new generator. The best way to do it is to use the generator combinators that exist
45+
/**
46+
* Let's see how to create a new generator. The best way to do it is to use the generator combinators that exist
4647
* in the `org.scalacheck.Gen` module. These can be combined using a for-comprehension. Suppose you need a generator
4748
* which generates a tuple that contains two random integer values, one of them being at least twice as big as the
4849
* other. The following definition does this:
@@ -65,11 +66,11 @@ object GeneratorsSection
6566

6667
}
6768

68-
/** You can create generators that pick one value out of a selection of values.
69+
/**
70+
* You can create generators that pick one value out of a selection of values.
6971
* The `oneOf` method creates a generator that randomly picks one of its parameters each time it generates a value.
7072
* Notice that plain values are implicitly converted to generators (which always generate that value) if needed.
7173
*
72-
*
7374
* The following generator generates a vowel:
7475
*/
7576
def genOf(res0: Seq[Char]) = {
@@ -86,7 +87,8 @@ object GeneratorsSection
8687
}
8788
}
8889

89-
/** The distribution is uniform, but if you want to control it you can use the frequency combinator:
90+
/**
91+
* The distribution is uniform, but if you want to control it you can use the frequency combinator:
9092
*
9193
* {{{
9294
* val vowel = Gen.frequency(
@@ -132,7 +134,8 @@ object GeneratorsSection
132134
}
133135
}
134136

135-
/** ==Conditional Generators==
137+
/**
138+
* ==Conditional Generators==
136139
*
137140
* Conditional generators can be defined using `Gen.suchThat`.
138141
*
@@ -153,7 +156,8 @@ object GeneratorsSection
153156
}
154157
}
155158

156-
/** ==Case class Generators==
159+
/**
160+
* ==Case class Generators==
157161
*
158162
* On the basis of the above we can create a generator for the following case class:
159163
*
@@ -176,7 +180,8 @@ object GeneratorsSection
176180
}
177181
}
178182

179-
/** ==Sized Generators==
183+
/**
184+
* ==Sized Generators==
180185
*
181186
* When ScalaCheck uses a generator to generate a value, it feeds it with some parameters. One of the parameters
182187
* the generator is given is a size value, which some generators use to generate their values.
@@ -212,7 +217,8 @@ object GeneratorsSection
212217
}
213218
}
214219

215-
/** ==Generating Containers==
220+
/**
221+
* ==Generating Containers==
216222
*
217223
* There is a special generator, `Gen.containerOf`, that generates containers such as lists and arrays.
218224
* It takes another generator as argument which is responsible for generating the individual items.

0 commit comments

Comments
 (0)