From 6f4852f8ddf10368024a9d4c9715a354a403be4d Mon Sep 17 00:00:00 2001 From: Juan Pedro Moreno Date: Thu, 18 Jun 2020 13:24:17 +0200 Subject: [PATCH] Prepare repository for next release and SBT build improvements --- .scalafmt.conf | 2 +- AUTHORS.md | 2 +- CONTRIBUTING.md | 2 +- LICENSE.md | 2 +- NOTICE.md | 2 +- build.sbt | 32 ++++++++---- {.docs => docs}/AUTHORS.md | 0 {.docs => docs}/CODE_OF_CONDUCT.md | 0 {.docs => docs}/CONTRIBUTING.md | 0 {.docs => docs}/LICENSE.md | 0 {.docs => docs}/NOTICE.md | 0 project/ProjectPlugin.scala | 49 ------------------- project/build.properties | 2 +- project/plugins.sbt | 18 +++---- .../scala/scalatutorial/ScalaTutorial.scala | 5 +- .../sections/ClassesVsCaseClasses.scala | 6 +-- .../sections/DefinitionsAndEvaluation.scala | 5 +- .../sections/FunctionalLoops.scala | 5 +- .../sections/HigherOrderFunctions.scala | 5 +- .../sections/ImperativeProgramming.scala | 5 +- .../sections/LazyEvaluation.scala | 9 ++-- .../sections/LexicalScopes.scala | 7 ++- .../sections/ObjectOrientedProgramming.scala | 5 +- .../sections/PolymorphicTypes.scala | 5 +- .../sections/ScalaTutorialSection.scala | 2 +- .../sections/StandardLibrary.scala | 8 +-- .../sections/StructuringInformation.scala | 8 +-- .../sections/SyntacticConveniences.scala | 5 +- .../sections/TailRecursion.scala | 5 +- .../sections/TermsAndTypes.scala | 6 +-- .../scalatutorial/sections/TypeClasses.scala | 7 +-- .../scalatutorial/utils/BankAccount.scala | 2 +- .../scala/scalatutorial/utils/IntSet.scala | 2 +- src/main/scala/scalatutorial/utils/Note.scala | 2 +- .../scala/scalatutorial/utils/Rational.scala | 2 +- .../scala/scalatutorial/utils/animals.scala | 2 +- .../scala/scalatutorial/utils/sorting.scala | 2 +- .../sections/ClassesVsCaseClassesSpec.scala | 2 +- .../DefinitionsAndEvaluationSpec.scala | 2 +- .../sections/FunctionalLoopsSpec.scala | 2 +- .../sections/HigherOrderFunctionsSpec.scala | 2 +- .../sections/ImperativeProgrammingSpec.scala | 2 +- .../sections/LazyEvaluationSpec.scala | 2 +- .../sections/LexicalScopesSpec.scala | 2 +- .../ObjectOrientedProgrammingSpec.scala | 2 +- .../sections/PolymorphicTypesSpec.scala | 2 +- .../sections/StandardLibrarySpec.scala | 2 +- .../sections/StructuringInformationSpec.scala | 2 +- .../sections/SyntacticConveniencesSpec.scala | 2 +- .../sections/TailRecursionSpec.scala | 2 +- .../sections/TermsAndTypesSpec.scala | 2 +- .../sections/TypeClassesSpec.scala | 2 +- 52 files changed, 113 insertions(+), 138 deletions(-) rename {.docs => docs}/AUTHORS.md (100%) rename {.docs => docs}/CODE_OF_CONDUCT.md (100%) rename {.docs => docs}/CONTRIBUTING.md (100%) rename {.docs => docs}/LICENSE.md (100%) rename {.docs => docs}/NOTICE.md (100%) delete mode 100644 project/ProjectPlugin.scala diff --git a/.scalafmt.conf b/.scalafmt.conf index 97595104..c67bf5c6 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=2.4.2 +version=2.6.0 style = defaultWithAlign maxColumn = 100 diff --git a/AUTHORS.md b/AUTHORS.md index f7f3aaa7..46a2cb77 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -28,8 +28,8 @@ These are the people that have contributed to the _exercises-scalatutorial_ proj - [![julienrf](https://avatars2.githubusercontent.com/u/332812?v=4&s=20) **julienrf**](https://github.com/julienrf) - [![juanpedromoreno](https://avatars2.githubusercontent.com/u/4879373?v=4&s=20) **juanpedromoreno**](https://github.com/juanpedromoreno) - [![jdesiloniz](https://avatars2.githubusercontent.com/u/2835739?v=4&s=20) **jdesiloniz**](https://github.com/jdesiloniz) -- [![kiroco12](https://avatars1.githubusercontent.com/u/48894338?v=4&s=20) **kiroco12**](https://github.com/kiroco12) - [![47erbot](https://avatars1.githubusercontent.com/u/24799081?v=4&s=20) **47erbot**](https://github.com/47erbot) +- [![kiroco12](https://avatars1.githubusercontent.com/u/48894338?v=4&s=20) **kiroco12**](https://github.com/kiroco12) - [![FRosner](https://avatars2.githubusercontent.com/u/3427394?v=4&s=20) **FRosner**](https://github.com/FRosner) - [![MaureenElsberry](https://avatars0.githubusercontent.com/u/17556002?v=4&s=20) **MaureenElsberry**](https://github.com/MaureenElsberry) - [![sauntimo](https://avatars3.githubusercontent.com/u/2720466?v=4&s=20) **sauntimo**](https://github.com/sauntimo) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b715d7b4..c256e2f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ the code. Pull requests are also welcome. People are expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md) when discussing _exercises-scalatutorial_ on the Github page or other venues. -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). +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). ## How can I help? diff --git a/LICENSE.md b/LICENSE.md index fef1c3a0..c21be17b 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (C) 2016-2020 47 Degrees + Copyright (C) 2016-2020 47 Degrees Open Source Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/NOTICE.md b/NOTICE.md index 99a4cddb..873780c7 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -4,6 +4,6 @@ exercises-scalatutorial -Copyright (c) 2016-2020 47 Degrees. All rights reserved. +Copyright (c) 2016-2020 47 Degrees Open Source. All rights reserved. Licensed under Apache-2.0. See [LICENSE](LICENSE.md) for terms. \ No newline at end of file diff --git a/build.sbt b/build.sbt index b35b01f5..116a7fb6 100644 --- a/build.sbt +++ b/build.sbt @@ -1,21 +1,35 @@ import com.jsuereth.sbtpgp.PgpKeys.publishSigned +ThisBuild / organization := "org.scala-exercises" +ThisBuild / githubOrganization := "47degrees" +ThisBuild / scalaVersion := "2.13.2" + +publish / skip := true + +// This is required by the exercises compiler: publishLocal := (publishLocal dependsOn compile).value publishSigned := (publishSigned dependsOn compile).value addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; test") -addCommandAlias("ci-docs", "github; project-docs/mdoc; headerCreateAll") +addCommandAlias("ci-docs", "github; documentation/mdoc; headerCreateAll") +addCommandAlias("ci-publish", "github; ci-release") lazy val exercises = (project in file(".")) - .settings(moduleName := "exercises-scalatutorial") - .settings(exercisesSettings) + .settings(name := "exercises-scalatutorial") + .settings( + libraryDependencies ++= Seq( + "org.scala-exercises" %% "exercise-compiler" % "0.6.1", + "org.scala-exercises" %% "definitions" % "0.6.1", + "com.chuusai" %% "shapeless" % "2.3.3", + "org.scalatest" %% "scalatest" % "3.1.2", + "org.scalacheck" %% "scalacheck" % "1.14.3", + "org.scalatestplus" %% "scalacheck-1-14" % "3.1.2.0", + "com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % "1.2.5" + ) + ) .enablePlugins(ExerciseCompilerPlugin) -lazy val `project-docs` = (project in file(".docs")) - .aggregate(exercises) - .dependsOn(exercises) - .settings(moduleName := "exercises-project-docs") - .settings(mdocIn := file(".docs")) +lazy val documentation = project .settings(mdocOut := file(".")) - .settings(skip in publish := true) + .settings(publish / skip := true) .enablePlugins(MdocPlugin) diff --git a/.docs/AUTHORS.md b/docs/AUTHORS.md similarity index 100% rename from .docs/AUTHORS.md rename to docs/AUTHORS.md diff --git a/.docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md similarity index 100% rename from .docs/CODE_OF_CONDUCT.md rename to docs/CODE_OF_CONDUCT.md diff --git a/.docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 100% rename from .docs/CONTRIBUTING.md rename to docs/CONTRIBUTING.md diff --git a/.docs/LICENSE.md b/docs/LICENSE.md similarity index 100% rename from .docs/LICENSE.md rename to docs/LICENSE.md diff --git a/.docs/NOTICE.md b/docs/NOTICE.md similarity index 100% rename from .docs/NOTICE.md rename to docs/NOTICE.md diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala deleted file mode 100644 index 5a6415da..00000000 --- a/project/ProjectPlugin.scala +++ /dev/null @@ -1,49 +0,0 @@ -import sbt.Keys._ -import sbt._ -import com.alejandrohdezma.sbt.github.SbtGithubPlugin - -object ProjectPlugin extends AutoPlugin { - - override def trigger: PluginTrigger = allRequirements - - override def requires: Plugins = plugins.JvmPlugin && SbtGithubPlugin - - object autoImport { - - lazy val V = new { - val shapeless: String = "2.3.3" - val scala: String = "2.13.2" - val scalaExercises: String = "0.6.0" - val scalacheck: String = "1.14.3" - val scalacheckShapeless: String = "1.2.5" - val scalatest: String = "3.1.2" - val scalatestplusScheck: String = "3.1.1.1" - } - - def dep(artifactId: String) = "org.scala-exercises" %% artifactId % V.scalaExercises - - lazy val exercisesSettings = Seq( - libraryDependencies ++= Seq( - dep("exercise-compiler"), - dep("definitions"), - "com.chuusai" %% "shapeless" % V.shapeless, - "org.scalatest" %% "scalatest" % V.scalatest, - "org.scalacheck" %% "scalacheck" % V.scalacheck, - "org.scalatestplus" %% "scalacheck-1-14" % V.scalatestplusScheck, - "com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless - ) - ) - } - - override def projectSettings: Seq[Def.Setting[_]] = - Seq( - organization := "org.scala-exercises", - organizationName := "47 Degrees", - organizationHomepage := Some(url("https://47deg.com")), - scalaVersion := autoImport.V.scala, - resolvers ++= Seq( - Resolver.sonatypeRepo("snapshots"), - Resolver.sonatypeRepo("releases") - ) - ) -} diff --git a/project/build.properties b/project/build.properties index 2cc552f5..0caa33f3 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.11 \ No newline at end of file +sbt.version=1.3.12 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 2ef287e2..729558cf 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,9 @@ -addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.0") -addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.5") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") -addSbtPlugin("com.alejandrohdezma" %% "sbt-github" % "0.8.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-mdoc-toc" % "0.2") +addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.1") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.5") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") diff --git a/src/main/scala/scalatutorial/ScalaTutorial.scala b/src/main/scala/scalatutorial/ScalaTutorial.scala index 3318a732..b44c8244 100644 --- a/src/main/scala/scalatutorial/ScalaTutorial.scala +++ b/src/main/scala/scalatutorial/ScalaTutorial.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,8 @@ import org.scalaexercises.definitions.Library import sections._ -/** Quickly learn Scala through an interactive tutorial based on the first two courses of the Scala MOOCs. +/** + * Quickly learn Scala through an interactive tutorial based on the first two courses of the Scala MOOCs. * * @param name scala_tutorial */ diff --git a/src/main/scala/scalatutorial/sections/ClassesVsCaseClasses.scala b/src/main/scala/scalatutorial/sections/ClassesVsCaseClasses.scala index efdc3154..92170cda 100644 --- a/src/main/scala/scalatutorial/sections/ClassesVsCaseClasses.scala +++ b/src/main/scala/scalatutorial/sections/ClassesVsCaseClasses.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,8 @@ package scalatutorial.sections import scalatutorial.utils.{BankAccount, Note} -/** @param name classes_vs_case_classes */ +/** + * @param name classes_vs_case_classes */ object ClassesVsCaseClasses extends ScalaTutorialSection { /** @@ -74,7 +75,6 @@ object ClassesVsCaseClasses extends ScalaTutorialSection { * members, whereas this is not the case with regular classes. * * = Equality = - * */ def equality(res0: Boolean, res1: Boolean): Unit = { val aliceAccount = new BankAccount diff --git a/src/main/scala/scalatutorial/sections/DefinitionsAndEvaluation.scala b/src/main/scala/scalatutorial/sections/DefinitionsAndEvaluation.scala index ea695409..341a976d 100644 --- a/src/main/scala/scalatutorial/sections/DefinitionsAndEvaluation.scala +++ b/src/main/scala/scalatutorial/sections/DefinitionsAndEvaluation.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name definitions_and_evaluation */ +/** + * @param name definitions_and_evaluation */ object DefinitionsAndEvaluation extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/FunctionalLoops.scala b/src/main/scala/scalatutorial/sections/FunctionalLoops.scala index 23320e1f..9a896c54 100644 --- a/src/main/scala/scalatutorial/sections/FunctionalLoops.scala +++ b/src/main/scala/scalatutorial/sections/FunctionalLoops.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name functional_loops */ +/** + * @param name functional_loops */ object FunctionalLoops extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala b/src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala index 4e64e494..3bb1c119 100644 --- a/src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala +++ b/src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name higher_order_functions */ +/** + * @param name higher_order_functions */ object HigherOrderFunctions extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/ImperativeProgramming.scala b/src/main/scala/scalatutorial/sections/ImperativeProgramming.scala index 66fdf735..56e8cdad 100644 --- a/src/main/scala/scalatutorial/sections/ImperativeProgramming.scala +++ b/src/main/scala/scalatutorial/sections/ImperativeProgramming.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,8 @@ package scalatutorial.sections import scalatutorial.utils.BankAccount -/** @param name imperative_programming */ +/** + * @param name imperative_programming */ object ImperativeProgramming extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/LazyEvaluation.scala b/src/main/scala/scalatutorial/sections/LazyEvaluation.scala index 25cffe51..6e9048b0 100644 --- a/src/main/scala/scalatutorial/sections/LazyEvaluation.scala +++ b/src/main/scala/scalatutorial/sections/LazyEvaluation.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name lazy_evaluation */ +/** + * @param name lazy_evaluation */ object LazyEvaluation extends ScalaTutorialSection { /** @@ -234,9 +235,9 @@ object LazyEvaluation extends ScalaTutorialSection { def lazyVal(res0: String): Unit = { val builder = new StringBuilder - val x = { builder += 'x'; 1 } + val x = { builder += 'x'; 1 } lazy val y = { builder += 'y'; 2 } - def z = { builder += 'z'; 3 } + def z = { builder += 'z'; 3 } z + y + x + z + y + x diff --git a/src/main/scala/scalatutorial/sections/LexicalScopes.scala b/src/main/scala/scalatutorial/sections/LexicalScopes.scala index e3a68ef4..9b34fc18 100644 --- a/src/main/scala/scalatutorial/sections/LexicalScopes.scala +++ b/src/main/scala/scalatutorial/sections/LexicalScopes.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name lexical_scopes */ +/** + * @param name lexical_scopes */ object LexicalScopes extends ScalaTutorialSection { /** @@ -75,7 +76,6 @@ object LexicalScopes extends ScalaTutorialSection { * == Exercise: Scope Rules == * * What is the value of `result` in the following program? - * */ def scopeRules(res0: Int): Unit = { val x = 0 @@ -286,7 +286,6 @@ object LexicalScopes extends ScalaTutorialSection { * }}} * * = Exercise = - * */ def objectScopes(res0: Int): Unit = { object Foo { diff --git a/src/main/scala/scalatutorial/sections/ObjectOrientedProgramming.scala b/src/main/scala/scalatutorial/sections/ObjectOrientedProgramming.scala index 70e79c92..5e73bff3 100644 --- a/src/main/scala/scalatutorial/sections/ObjectOrientedProgramming.scala +++ b/src/main/scala/scalatutorial/sections/ObjectOrientedProgramming.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,8 @@ package scalatutorial.sections import scalatutorial.utils.{Empty, NonEmpty} -/** @param name object_oriented_programming */ +/** + * @param name object_oriented_programming */ object ObjectOrientedProgramming extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/PolymorphicTypes.scala b/src/main/scala/scalatutorial/sections/PolymorphicTypes.scala index 273c0cf5..edcf8aec 100644 --- a/src/main/scala/scalatutorial/sections/PolymorphicTypes.scala +++ b/src/main/scala/scalatutorial/sections/PolymorphicTypes.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name polymorphic_types */ +/** + * @param name polymorphic_types */ object PolymorphicTypes extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/ScalaTutorialSection.scala b/src/main/scala/scalatutorial/sections/ScalaTutorialSection.scala index 10fb2d02..9756888c 100644 --- a/src/main/scala/scalatutorial/sections/ScalaTutorialSection.scala +++ b/src/main/scala/scalatutorial/sections/ScalaTutorialSection.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/scalatutorial/sections/StandardLibrary.scala b/src/main/scala/scalatutorial/sections/StandardLibrary.scala index 29389418..e8ae250f 100644 --- a/src/main/scala/scalatutorial/sections/StandardLibrary.scala +++ b/src/main/scala/scalatutorial/sections/StandardLibrary.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name standard_library */ +/** + * @param name standard_library */ object StandardLibrary extends ScalaTutorialSection { /** @@ -216,12 +217,11 @@ object StandardLibrary extends ScalaTutorialSection { /** * Filter values with `filter`: - * */ def optionFilter(res0: Option[Int], res1: Option[Int]): Unit = { Some(1).filter(x => x % 2 == 0) shouldBe None Some(2).filter(x => x % 2 == 0) shouldBe Some(2) - res0.filter(x => x % 2 == 0) shouldBe res1 + res0.filter(x => x % 2 == 0) shouldBe res1 } /** diff --git a/src/main/scala/scalatutorial/sections/StructuringInformation.scala b/src/main/scala/scalatutorial/sections/StructuringInformation.scala index bdef5fd0..154e771a 100644 --- a/src/main/scala/scalatutorial/sections/StructuringInformation.scala +++ b/src/main/scala/scalatutorial/sections/StructuringInformation.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name structuring_information */ +/** + * @param name structuring_information */ object StructuringInformation extends ScalaTutorialSection { /** @@ -163,7 +164,7 @@ object StructuringInformation extends ScalaTutorialSection { * case Rest(duration) => duration * } * } - *}}} + * }}} * * If we try to run the above code to see how the compiler informs us that * we don’t handle all the cases in `nonExhaustiveDuration`. @@ -172,7 +173,6 @@ object StructuringInformation extends ScalaTutorialSection { * * It is worth noting that, since the purpose of case classes is to * aggregate values, comparing case class instances compares their values: - * */ def caseClassEquals(res0: Boolean, res1: Boolean): Unit = { case class Note(name: String, duration: String, octave: Int) diff --git a/src/main/scala/scalatutorial/sections/SyntacticConveniences.scala b/src/main/scala/scalatutorial/sections/SyntacticConveniences.scala index 4ad1bb60..a2784684 100644 --- a/src/main/scala/scalatutorial/sections/SyntacticConveniences.scala +++ b/src/main/scala/scalatutorial/sections/SyntacticConveniences.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name syntactic_conveniences */ +/** + * @param name syntactic_conveniences */ object SyntacticConveniences extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/TailRecursion.scala b/src/main/scala/scalatutorial/sections/TailRecursion.scala index 1dcff2ff..171c40a0 100644 --- a/src/main/scala/scalatutorial/sections/TailRecursion.scala +++ b/src/main/scala/scalatutorial/sections/TailRecursion.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,8 @@ package scalatutorial.sections import scala.annotation.tailrec -/** @param name tail_recursion */ +/** + * @param name tail_recursion */ object TailRecursion extends ScalaTutorialSection { /** diff --git a/src/main/scala/scalatutorial/sections/TermsAndTypes.scala b/src/main/scala/scalatutorial/sections/TermsAndTypes.scala index 9a763a90..7c3ff63d 100644 --- a/src/main/scala/scalatutorial/sections/TermsAndTypes.scala +++ b/src/main/scala/scalatutorial/sections/TermsAndTypes.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,8 @@ package scalatutorial.sections -/** @param name terms_and_types */ +/** + * @param name terms_and_types */ object TermsAndTypes extends ScalaTutorialSection { /** @@ -100,7 +101,6 @@ object TermsAndTypes extends ScalaTutorialSection { * 3 * 3 * 9 * }}} - * */ def evaluation(res0: Int, res1: String): Unit = { 1 + 2 shouldBe res0 diff --git a/src/main/scala/scalatutorial/sections/TypeClasses.scala b/src/main/scala/scalatutorial/sections/TypeClasses.scala index 66e578f8..d76c7be8 100644 --- a/src/main/scala/scalatutorial/sections/TypeClasses.scala +++ b/src/main/scala/scalatutorial/sections/TypeClasses.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,8 @@ package scalatutorial.sections import scalatutorial.utils.Rational import scalatutorial.utils.Sorting.insertionSort -/** @param name type_classes */ +/** + * @param name type_classes */ object TypeClasses extends ScalaTutorialSection { /** @@ -77,7 +78,7 @@ object TypeClasses extends ScalaTutorialSection { * } * } * }}} - + * * = Calling Parameterized Sort = * * We can now call `insertionSort` as follows: diff --git a/src/main/scala/scalatutorial/utils/BankAccount.scala b/src/main/scala/scalatutorial/utils/BankAccount.scala index 7ba2b9b9..08dfbe06 100644 --- a/src/main/scala/scalatutorial/utils/BankAccount.scala +++ b/src/main/scala/scalatutorial/utils/BankAccount.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/scalatutorial/utils/IntSet.scala b/src/main/scala/scalatutorial/utils/IntSet.scala index 6b6607cf..9990010c 100644 --- a/src/main/scala/scalatutorial/utils/IntSet.scala +++ b/src/main/scala/scalatutorial/utils/IntSet.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/scalatutorial/utils/Note.scala b/src/main/scala/scalatutorial/utils/Note.scala index e5a8b343..b81261ec 100644 --- a/src/main/scala/scalatutorial/utils/Note.scala +++ b/src/main/scala/scalatutorial/utils/Note.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/scalatutorial/utils/Rational.scala b/src/main/scala/scalatutorial/utils/Rational.scala index 65039bab..3b1d12fe 100644 --- a/src/main/scala/scalatutorial/utils/Rational.scala +++ b/src/main/scala/scalatutorial/utils/Rational.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/scalatutorial/utils/animals.scala b/src/main/scala/scalatutorial/utils/animals.scala index 21729397..4e8d561e 100644 --- a/src/main/scala/scalatutorial/utils/animals.scala +++ b/src/main/scala/scalatutorial/utils/animals.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/scalatutorial/utils/sorting.scala b/src/main/scala/scalatutorial/utils/sorting.scala index 62bd6772..f21bb401 100644 --- a/src/main/scala/scalatutorial/utils/sorting.scala +++ b/src/main/scala/scalatutorial/utils/sorting.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/ClassesVsCaseClassesSpec.scala b/src/test/scala/scalatutorial/sections/ClassesVsCaseClassesSpec.scala index d31add17..24f54d39 100644 --- a/src/test/scala/scalatutorial/sections/ClassesVsCaseClassesSpec.scala +++ b/src/test/scala/scalatutorial/sections/ClassesVsCaseClassesSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/DefinitionsAndEvaluationSpec.scala b/src/test/scala/scalatutorial/sections/DefinitionsAndEvaluationSpec.scala index 84eeaca3..08192439 100644 --- a/src/test/scala/scalatutorial/sections/DefinitionsAndEvaluationSpec.scala +++ b/src/test/scala/scalatutorial/sections/DefinitionsAndEvaluationSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/FunctionalLoopsSpec.scala b/src/test/scala/scalatutorial/sections/FunctionalLoopsSpec.scala index bd87c35d..5a28d3dd 100644 --- a/src/test/scala/scalatutorial/sections/FunctionalLoopsSpec.scala +++ b/src/test/scala/scalatutorial/sections/FunctionalLoopsSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/HigherOrderFunctionsSpec.scala b/src/test/scala/scalatutorial/sections/HigherOrderFunctionsSpec.scala index 9aa3b877..e2126a9a 100644 --- a/src/test/scala/scalatutorial/sections/HigherOrderFunctionsSpec.scala +++ b/src/test/scala/scalatutorial/sections/HigherOrderFunctionsSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/ImperativeProgrammingSpec.scala b/src/test/scala/scalatutorial/sections/ImperativeProgrammingSpec.scala index 44318a43..627b5744 100644 --- a/src/test/scala/scalatutorial/sections/ImperativeProgrammingSpec.scala +++ b/src/test/scala/scalatutorial/sections/ImperativeProgrammingSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/LazyEvaluationSpec.scala b/src/test/scala/scalatutorial/sections/LazyEvaluationSpec.scala index ef1beb52..b2b39748 100644 --- a/src/test/scala/scalatutorial/sections/LazyEvaluationSpec.scala +++ b/src/test/scala/scalatutorial/sections/LazyEvaluationSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/LexicalScopesSpec.scala b/src/test/scala/scalatutorial/sections/LexicalScopesSpec.scala index ff5bff1c..da827d2f 100644 --- a/src/test/scala/scalatutorial/sections/LexicalScopesSpec.scala +++ b/src/test/scala/scalatutorial/sections/LexicalScopesSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/ObjectOrientedProgrammingSpec.scala b/src/test/scala/scalatutorial/sections/ObjectOrientedProgrammingSpec.scala index b5f451bd..b2109ef1 100644 --- a/src/test/scala/scalatutorial/sections/ObjectOrientedProgrammingSpec.scala +++ b/src/test/scala/scalatutorial/sections/ObjectOrientedProgrammingSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/PolymorphicTypesSpec.scala b/src/test/scala/scalatutorial/sections/PolymorphicTypesSpec.scala index f2df44fc..746a3842 100644 --- a/src/test/scala/scalatutorial/sections/PolymorphicTypesSpec.scala +++ b/src/test/scala/scalatutorial/sections/PolymorphicTypesSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/StandardLibrarySpec.scala b/src/test/scala/scalatutorial/sections/StandardLibrarySpec.scala index fa39049d..eed94390 100644 --- a/src/test/scala/scalatutorial/sections/StandardLibrarySpec.scala +++ b/src/test/scala/scalatutorial/sections/StandardLibrarySpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/StructuringInformationSpec.scala b/src/test/scala/scalatutorial/sections/StructuringInformationSpec.scala index e937856c..2057a810 100644 --- a/src/test/scala/scalatutorial/sections/StructuringInformationSpec.scala +++ b/src/test/scala/scalatutorial/sections/StructuringInformationSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/SyntacticConveniencesSpec.scala b/src/test/scala/scalatutorial/sections/SyntacticConveniencesSpec.scala index a83c63b9..b01f483c 100644 --- a/src/test/scala/scalatutorial/sections/SyntacticConveniencesSpec.scala +++ b/src/test/scala/scalatutorial/sections/SyntacticConveniencesSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/TailRecursionSpec.scala b/src/test/scala/scalatutorial/sections/TailRecursionSpec.scala index 3db60c42..aee2957a 100644 --- a/src/test/scala/scalatutorial/sections/TailRecursionSpec.scala +++ b/src/test/scala/scalatutorial/sections/TailRecursionSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/TermsAndTypesSpec.scala b/src/test/scala/scalatutorial/sections/TermsAndTypesSpec.scala index f8271d8e..6e3efd17 100644 --- a/src/test/scala/scalatutorial/sections/TermsAndTypesSpec.scala +++ b/src/test/scala/scalatutorial/sections/TermsAndTypesSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/scala/scalatutorial/sections/TypeClassesSpec.scala b/src/test/scala/scalatutorial/sections/TypeClassesSpec.scala index cc4dae6a..ddeedd32 100644 --- a/src/test/scala/scalatutorial/sections/TypeClassesSpec.scala +++ b/src/test/scala/scalatutorial/sections/TypeClassesSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 47 Degrees + * Copyright 2016-2020 47 Degrees Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.