Skip to content

Commit 184c233

Browse files
Prepare repository for next release and SBT build improvements (#200)
1 parent c898492 commit 184c233

File tree

89 files changed

+843
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+843
-583
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-stdlib_ 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-stdlib
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

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
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-stdlib")
11-
.settings(exercisesSettings)
18+
.settings(name := "exercises-stdlib")
19+
.settings(
20+
libraryDependencies ++= Seq(
21+
"org.scala-exercises" %% "exercise-compiler" % "0.6.1",
22+
"org.scala-exercises" %% "definitions" % "0.6.1",
23+
"com.chuusai" %% "shapeless" % "2.3.3",
24+
"org.scalatest" %% "scalatest" % "3.1.2",
25+
"org.scalacheck" %% "scalacheck" % "1.14.3",
26+
"org.scalatestplus" %% "scalacheck-1-14" % "3.1.2.0",
27+
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % "1.2.5"
28+
)
29+
)
1230
.enablePlugins(ExerciseCompilerPlugin)
1331

14-
lazy val `project-docs` = (project in file(".docs"))
15-
.aggregate(exercises)
16-
.settings(moduleName := "exercises-project-docs")
17-
.settings(mdocIn := file(".docs"))
32+
lazy val documentation = project
1833
.settings(mdocOut := file("."))
19-
.settings(skip in publish := true)
34+
.settings(publish / skip := true)
2035
.enablePlugins(MdocPlugin)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

project/ProjectPlugin.scala

-45
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-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.0")
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.3.4")
5-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
6-
addSbtPlugin("com.alejandrohdezma" %% "sbt-github" % "0.8.0")
7-
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.0")
8-
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.0")
9-
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/stdlib/Asserts.scala

+11-7
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,11 +19,13 @@ package stdlib
1919
import org.scalatest.flatspec.AnyFlatSpec
2020
import org.scalatest.matchers.should.Matchers
2121

22-
/** @param name asserts
22+
/**
23+
* @param name asserts
2324
*/
2425
object Asserts extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {
2526

26-
/** ScalaTest makes three assertions available by default in any style trait. You can use:
27+
/**
28+
* ScalaTest makes three assertions available by default in any style trait. You can use:
2729
*
2830
* - `assert` for general assertions;
2931
* - `assertResult` to differentiate expected from actual values;
@@ -41,7 +43,6 @@ object Asserts extends AnyFlatSpec with Matchers with org.scalaexercises.definit
4143
* Scala's `assert` will complete abruptly with an `AssertionError`. This behavior is provided by
4244
* the `assert` method defined in object `Predef`, whose members are implicitly imported into every Scala source file.
4345
*
44-
*
4546
* ScalaTest provides a domain specific language (DSL) for expressing assertions in tests
4647
* using the word `should`. ScalaTest matchers provides five different ways to check equality, each designed to address a different need. They are:
4748
*
@@ -58,16 +59,19 @@ object Asserts extends AnyFlatSpec with Matchers with org.scalaexercises.definit
5859
def scalaTestAsserts(res0: Boolean) =
5960
true should be(res0)
6061

61-
/** Booleans in asserts can test equality:
62+
/**
63+
* Booleans in asserts can test equality:
6264
*/
6365
def booleanAsserts(res0: Int) = {
6466
val v1 = 4
6567
v1 shouldEqual res0
6668

67-
/** `shouldEqual` is an assertion. It is from ScalaTest, not from the Scala language. */
69+
/**
70+
* `shouldEqual` is an assertion. It is from ScalaTest, not from the Scala language. */
6871
}
6972

70-
/** Sometimes we expect you to fill in the values:
73+
/**
74+
* Sometimes we expect you to fill in the values:
7175
*/
7276
def valuesAsserts(res0: Int) =
7377
assert(res0 == 1 + 1)

src/main/scala/stdlib/ByNameParameter.scala

+13-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,20 +19,21 @@ package stdlib
1919
import org.scalatest.flatspec.AnyFlatSpec
2020
import org.scalatest.matchers.should.Matchers
2121

22-
/** @param name byname_parameter
22+
/**
23+
* @param name byname_parameter
2324
*/
2425
object ByNameParameter
2526
extends AnyFlatSpec
2627
with Matchers
2728
with org.scalaexercises.definitions.Section {
2829

29-
/** `() => Int` is a Function type that takes a `Unit` type. `Unit` is known as `void` to a Java programmer. The function returns an `Int`. You can place this as a method parameter so that you can you use it as a block, but still it doesn't look quite right:
30+
/**
31+
* `() => Int` is a Function type that takes a `Unit` type. `Unit` is known as `void` to a Java programmer. The function returns an `Int`. You can place this as a method parameter so that you can you use it as a block, but still it doesn't look quite right:
3032
*/
3133
def takesUnitByNameParameter(res0: Either[Throwable, Int]) = {
3234
def calc(x: () => Int): Either[Throwable, Int] = {
33-
try {
34-
Right(x()) // An explicit call of the x function
35-
} catch {
35+
try Right(x()) // An explicit call of the x function
36+
catch {
3637
case b: Throwable => Left(b)
3738
}
3839
}
@@ -44,14 +45,14 @@ object ByNameParameter
4445
y should be(res0)
4546
}
4647

47-
/** A by-name parameter does the same thing as the previous koan but there is no need to explicitly handle `Unit` or `()`. This is used extensively in Scala to create blocks:
48+
/**
49+
* A by-name parameter does the same thing as the previous koan but there is no need to explicitly handle `Unit` or `()`. This is used extensively in Scala to create blocks:
4850
*/
4951
def byNameParameter(res0: Either[Throwable, Int]) = {
5052
def calc(x: => Int): Either[Throwable, Int] = {
5153
// x is a call by-name parameter
52-
try {
53-
Right(x)
54-
} catch {
54+
try Right(x)
55+
catch {
5556
case b: Throwable => Left(b)
5657
}
5758
}
@@ -66,7 +67,8 @@ object ByNameParameter
6667
y should be(res0)
6768
}
6869

69-
/** By-name parameters can also be used with `object` and `apply` to make interesting block-like calls:
70+
/**
71+
* By-name parameters can also be used with `object` and `apply` to make interesting block-like calls:
7072
*/
7173
def withApplyByNameParameter(res0: String) = {
7274
object PigLatinizer {

0 commit comments

Comments
 (0)