Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is a [Giter8][g8] template for creating libraries ready to be published.
Using [sbt](https://www.scala-sbt.org/download.html) run the following in a terminal:

```sh
sbt --sbt-version 1.5.5 new alexandru/typelevel-library.g8
sbt --sbt-version 1.6.2 new alexandru/typelevel-library.g8
```

### Configuration of Automatic Releases to Sonatype
Expand Down
24 changes: 8 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
val CatsVersion = "2.6.1"
val CatsEffectVersion = "3.2.7"
val MacroParadiseVersion = "2.1.1"
val ScalaCheckVersion = "1.15.4"
val CatsVersion = "2.7.0"
val ScalaCheckVersion = "1.16.0"
val KindProjectorVersion = "0.13.2"
val BetterMonadicForVersion = "0.3.1"
val GitHub4sVersion = "0.29.1"
val ScalaTestVersion = "3.2.9"
val ScalaTestPlusVersion = "3.2.9.0"
val GitHub4sVersion = "0.31.0"
val ScalaTestVersion = "3.2.12"
val ScalaTestPlusVersion = "3.2.12.0"

lazy val root = (project in file("."))
.settings(
scalaVersion := "2.12.14",
crossScalaVersions := Seq("2.12.14", "2.13.6", "3.0.2"),
scalaVersion := "2.12.15",
crossScalaVersions := Seq("2.12.15", "2.13.8", "3.1.2"),

Test / test := {
val _ = (Test / g8Test).toTask("").value
Expand All @@ -24,20 +21,15 @@ lazy val root = (project in file("."))
// update the g8 template as well
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-15" % ScalaTestPlusVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-16" % ScalaTestPlusVersion % Test,
"org.scalacheck" %%% "scalacheck" % ScalaCheckVersion % Test,
"org.typelevel" %%% "cats-core" % CatsVersion % Test,
"org.typelevel" %%% "cats-effect" % CatsEffectVersion % Test,
"org.typelevel" %%% "cats-effect-laws" % CatsEffectVersion % Test,
"org.typelevel" %%% "cats-laws" % CatsVersion % Test,
"com.47deg" %%% "github4s" % GitHub4sVersion % Test,
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Seq(
compilerPlugin(("org.typelevel" % "kind-projector" % KindProjectorVersion).cross(CrossVersion.full) % Test),
compilerPlugin(("org.scalamacros" % "paradise" % MacroParadiseVersion).cross(CrossVersion.patch) % Test),
compilerPlugin("com.olegpy" %% "better-monadic-for" % BetterMonadicForVersion % Test),
)
case _ =>
Seq.empty
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.5
sbt.version=1.6.2
24 changes: 11 additions & 13 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
val ScalaJSVersion = Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.7.0")
val ScalaJSVersion = Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.10.0")

addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0")
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.3.4")
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.9")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.10.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.3.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % ScalaJSVersion)
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.23")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) $copyright_start_year$ the $name$ contributors.
* Copyright (c) $copyright_start_year$ $name$ Contributors.
* See the project homepage at: https://$microsite_domain$$microsite_base_url$
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -29,6 +29,7 @@ object Example {
* import cats.implicits._
*
* Example.sumAll(List(1, 2, 3, 4))
* ()
* }}}
*/
def sumAll[F[_]: Traverse, A: Monoid](list: F[A]): A =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) $copyright_start_year$ the $name$ contributors.
* Copyright (c) $copyright_start_year$ $name$ Contributors.
* See the project homepage at: https://$microsite_domain$$microsite_base_url$
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
16 changes: 8 additions & 8 deletions src/main/g8/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
java: [8, 11]
scala: [2.12.14, 2.13.6, 3.0.2]
scala: [2.12.15, 2.13.8, 3.1.2]
command: ["ci-jvm"]

runs-on: \${{ matrix.os }}
Expand All @@ -40,8 +40,8 @@ jobs:
matrix:
os: [ubuntu-20.04]
java: [11]
scala: [2.12.14, 2.13.6, 3.0.2]
scalajs: [1.7.0]
scala: [2.12.15, 2.13.8, 3.1.2]
scalajs: [1.10.0]
command: [ci-js]

runs-on: \${{ matrix.os }}
Expand All @@ -67,8 +67,8 @@ jobs:
matrix:
os: [ubuntu-20.04]
java: [11]
scala: [2.12.14, 2.13.6, 3.0.2]
scalajs: [1.7.0]
scala: [2.12.15, 2.13.8, 3.1.2]
scalajs: [1.10.0]
command: [ci-package]

runs-on: \${{ matrix.os }}
Expand All @@ -94,8 +94,8 @@ jobs:
matrix:
os: [ubuntu-20.04]
java: [11]
scala: [2.13.6]
scalajs: [1.7.0]
scala: [2.13.8]
scalajs: [1.10.0]
command: ["ci-doc"]

runs-on: \${{ matrix.os }}
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
fail-fast: true
max-parallel: 1
matrix:
scalajs: ["", 1.7.0]
scalajs: ["", 1.10.0]
command: [ci-release]

runs-on: ubuntu-20.04
Expand Down
116 changes: 45 additions & 71 deletions src/main/g8/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,87 +1,61 @@
version = "2.5.1"

#
# See http://scalameta.org/scalafmt/#Configuration for details
#
project {
includeFilters = [
".*\\\\.scala\$"
".*\\\\.sbt\$"
]
version = "3.5.2"
runner.dialect = scala213source3

project.git = true
preset = default

align.preset = none
align.tokens = [
{code = "<-"},
]

fileOverride {
"glob:**/src/main/scala-3*/**" {
runner.dialect = scala3
},
"glob:**/*.sbt" {
align.tokens = [
{code = "<-"},
{code = "="},
{code = "%", owners = [{regex = "Term.ApplyInfix"}]},
{code = "%%", owners = [{regex = "Term.ApplyInfix"}]}
]
},
"glob:**/project/*.scala" {
align.tokens = [
{code = "<-"},
{code = "="},
{code = "%", owners = [{regex = "Term.ApplyInfix"}]},
{code = "%%", owners = [{regex = "Term.ApplyInfix"}]}
]
}
}

docstrings.style = keep
maxColumn = 120

# Vertical alignment, options: none, some, more
#
# This awkward, self-contradictory, configuration ensures that only
# the common sbt tokens get aligned, and not "production" code.
#
align = none
align {
openParenCallSite = false
openParenDefnSite = false
tokens = ["%", ":=", "~=", "<-"]
}

# If true, the margin character | is aligned with the opening triple quote string literals
assumeStandardLibraryStripMargin = true
rewrite.rules = [
SortImports,
AvoidInfix,
]

#From scalafmt website:
#see: http://scalameta.org/scalafmt/#includeCurlyBraceInSelectChains
includeCurlyBraceInSelectChains = false
spaces.inImportCurlyBraces = true
includeNoParensInSelectChains = false
trailingCommas = preserve

continuationIndent {
callSite = 2
defnSite = 2
extendSite = 2
}

danglingParentheses = false


newlines {
alwaysBeforeTopLevelStatements = false
sometimesBeforeColonInMethodReturnType = true
penalizeSingleSelectMultiArgList = false
alwaysBeforeElseAfterCurlyIf = false
neverInResultType = false
}

spaces {
afterKeywordBeforeParen = true
}

binPack {
parentConstructors = true
literalArgumentLists = true
}

optIn {
breaksInsideChains = false
breakChainOnFirstMethodDot = true
configStyleArguments = true
}

runner {
optimizer {
# Set to -1 to disable. Number of characters needed to trigger "config-style" formatting
# see: http://scalameta.org/scalafmt/#runner.optimizer.forceConfigStyleOnOffset
forceConfigStyleOnOffset = 150

# minimum number of func arguments before config-style (look at top of file) is enabled
forceConfigStyleMinArgCount = 2
}
}

rewrite {
rules = [
SortImports
# if your for has more than one single <- then it gets transformed into a multit-line curly brace one
# PreferCurlyFors
]
forceBlankLineBeforeDocstring = false
}

optIn {
blankLineBeforeDocstring = true
newlines {
source = keep
afterCurlyLambdaParams = preserve
beforeCurlyLambdaParams = multilineWithCaseOnly
topLevelBodyIfMinStatements = []
}
2 changes: 1 addition & 1 deletion src/main/g8/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ We hope that our community will be respectful, helpful, and kind. If you find yo
All code must be licensed under the Apache 2.0 license and all files must include the following copyright header:

```
Copyright (c) \$today.year the $name$ contributors.
Copyright (c) \$today.year $name$ Contributors.
See the project homepage at: https://$microsite_domain$$microsite_base_url$

Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading