Skip to content

Commit be4ac5b

Browse files
Updates Project
1 parent 1d90206 commit be4ac5b

21 files changed

+97
-125
lines changed

.scalafmt.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version=2.4.2
12
style = defaultWithAlign
23
maxColumn = 100
34

@@ -19,5 +20,4 @@ docstrings = JavaDoc
1920
rewrite {
2021
rules = [SortImports, RedundantBraces]
2122
redundantBraces.maxLines = 1
22-
}
23-
23+
}

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Scala Exercises - Cats library
2-
------------------------
32

43
This repository hosts a content library for the [Scala Exercises](https://www.scala-exercises.org/) platform that includes interactive exercises related to the [Cats library](https://github.com/typelevel/cats) by Typelevel.
54

build.sbt

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
import ProjectPlugin.autoImport._
2-
val scalaExercisesV = "0.6.0-SNAPSHOT"
1+
addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; test")
2+
addCommandAlias("ci-docs", "github; project-docs/mdoc; headerCreateAll")
33

4-
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExercisesV
5-
6-
lazy val cats = (project in file("."))
4+
lazy val exercises = (project in file("."))
5+
.settings(moduleName := "exercises-cats")
6+
.settings(exercisesSettings)
77
.enablePlugins(ExerciseCompilerPlugin)
8-
.settings(
9-
name := "exercises-cats",
10-
libraryDependencies ++= Seq(
11-
dep("exercise-compiler"),
12-
dep("definitions"),
13-
%%("cats-core", V.cats),
14-
%%("shapeless", V.shapeless),
15-
%%("scalatest", V.scalatest),
16-
%%("scalacheck", V.scalacheck),
17-
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless,
18-
"org.scalatestplus" %% "scalatestplus-scalacheck" % V.scalatestplusScheck
19-
),
20-
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
21-
)
22-
23-
// Distribution
248

25-
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
26-
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
27-
pgpSecretRing := file(s"$gpgFolder/secring.gpg")
9+
lazy val `project-docs` = (project in file(".docs"))
10+
.aggregate(exercises)
11+
.dependsOn(exercises)
12+
.settings(moduleName := "exercises-project-docs")
13+
.settings(mdocIn := file(".docs"))
14+
.settings(mdocOut := file("."))
15+
.settings(skip in publish := true)
16+
.enablePlugins(MdocPlugin)

project/ProjectPlugin.scala

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,52 @@
1-
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
2-
import de.heikoseeberger.sbtheader.License._
31
import sbt.Keys._
42
import sbt._
5-
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
6-
import sbtorgpolicies._
7-
import sbtorgpolicies.model._
3+
import com.alejandrohdezma.sbt.github.SbtGithubPlugin
84

95
object ProjectPlugin extends AutoPlugin {
106

117
override def trigger: PluginTrigger = allRequirements
128

13-
override def requires: Plugins = plugins.JvmPlugin && OrgPoliciesPlugin
9+
override def requires: Plugins = plugins.JvmPlugin && SbtGithubPlugin
1410

1511
object autoImport {
1612

1713
lazy val V = new {
18-
val scala213: String = "2.13.1"
19-
val cats: String = "2.0.0"
14+
val cats: String = "2.1.1"
2015
val shapeless: String = "2.3.3"
21-
val scalatest: String = "3.1.1"
22-
val scalatestplusScheck: String = "3.1.0.0-RC2"
16+
val scala: String = "2.13.2"
17+
val scalaExercises: String = "0.6.0-SNAPSHOT"
2318
val scalacheck: String = "1.14.3"
2419
val scalacheckShapeless: String = "1.2.5"
20+
val scalatest: String = "3.1.1"
21+
val scalatestplusScheck: String = "3.1.1.1"
2522
}
26-
}
2723

28-
import autoImport._
24+
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % V.scalaExercises
25+
26+
lazy val exercisesSettings = Seq(
27+
libraryDependencies ++= Seq(
28+
dep("exercise-compiler"),
29+
dep("definitions"),
30+
"org.typelevel" %% "cats-core" % V.cats,
31+
"com.chuusai" %% "shapeless" % V.shapeless,
32+
"org.scalatest" %% "scalatest" % V.scalatest,
33+
"org.scalacheck" %% "scalacheck" % V.scalacheck,
34+
"org.scalatestplus" %% "scalacheck-1-14" % V.scalatestplusScheck,
35+
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless
36+
),
37+
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
38+
)
39+
}
2940

3041
override def projectSettings: Seq[Def.Setting[_]] =
3142
Seq(
32-
description := "Scala Exercises: The path to enlightenment",
33-
startYear := Option(2016),
34-
orgGithubSetting := GitHubSettings(
35-
organization = "scala-exercises",
36-
project = name.value,
37-
organizationName = "Scala Exercises",
38-
groupId = "org.scala-exercises",
39-
organizationHomePage = url("https://www.scala-exercises.org"),
40-
organizationEmail = "hello@47deg.com"
41-
),
42-
orgLicenseSetting := ApacheLicense,
43-
scalaVersion := V.scala213,
44-
scalaOrganization := "org.scala-lang",
43+
organization := "org.scala-exercises",
44+
organizationName := "47 Degrees",
45+
organizationHomepage := Some(url("https://47deg.com")),
46+
scalaVersion := autoImport.V.scala,
4547
resolvers ++= Seq(
46-
Resolver.mavenLocal,
4748
Resolver.sonatypeRepo("snapshots"),
4849
Resolver.sonatypeRepo("releases")
49-
),
50-
headerLicense := Some(Custom(s"""| scala-exercises - ${name.value}
51-
| Copyright (C) 2015-2020 47 Degrees, LLC. <http://www.47deg.com>
52-
|
53-
|""".stripMargin))
50+
)
5451
)
5552
}

project/plugins.sbt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
resolvers ++= Seq(
2-
Resolver.sonatypeRepo("snapshots")
3-
)
4-
5-
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.0-SNAPSHOT")
6-
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.12.0-M3")
1+
resolvers += Resolver.sonatypeRepo("snapshots")
2+
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.0-SNAPSHOT")
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")

pubring.gpg

Lines changed: 0 additions & 18 deletions
This file was deleted.

secring.gpg.enc

-1.81 KB
Binary file not shown.

src/main/scala/catslib/Apply.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ object ApplySection extends AnyFlatSpec with Matchers with org.scalaexercises.de
8484
res1: Option[Int],
8585
res2: Option[Int],
8686
res3: Option[Int],
87-
res4: Option[Int]) = {
87+
res4: Option[Int]
88+
) = {
8889
Apply[Option].ap(Some(intToString))(Some(1)) should be(res0)
8990
Apply[Option].ap(Some(double))(Some(1)) should be(res1)
9091
Apply[Option].ap(Some(double))(None) should be(res2)

src/main/scala/catslib/EitherSection.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ object EitherSection extends AnyFlatSpec with Matchers with org.scalaexercises.d
373373
def eitherInTheLarge(
374374
res0: Either[String, Int],
375375
res1: Either[String, Int],
376-
res2: Either[String, Int]) = {
376+
res2: Either[String, Int]
377+
) = {
377378
val right: Either[String, Int] = Right(41)
378379
right.map(_ + 1) should be(res0)
379380

0 commit comments

Comments
 (0)