Skip to content

Commit

Permalink
merge settings
Browse files Browse the repository at this point in the history
rmgk committed Oct 25, 2023

Verified

This commit was signed with the committer’s verified signature.
caixw caixw
1 parent 9e50ab0 commit d12ee72
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@ newlines.source = keep
// use good judgement
rewrite.trailingCommas.style = keep

// docstrings are the scaladoc comments (using /** */)
// single line folding reduces empty lines.
// wrapping is disabled because I do not believe in forcing word-wrap for flow text – use good judgement
docstrings.oneline = fold
docstrings.wrap = no

@@ -27,6 +30,9 @@ indentOperator.exemptScope = all
indentOperator.includeRegex = "^.*=$"
indentOperator.excludeRegex = "^$"


// scala 2, scala 3, and sbt all use slightly different variants on scala syntax
// this defaults to scala 3 syntax, but has some well-known exceptions
runner.dialect = scala3
fileOverride {
"glob:**/scala-2/**" {
@@ -35,4 +41,8 @@ fileOverride {
"glob:**/*.sbt" {
runner.dialect = sbt1
}
// project files are sbt projects, sbt always uses scala 2.12
"glob:**/project/**" {
runner.dialect = scala212
}
}
7 changes: 7 additions & 0 deletions project/Settings.scala
Original file line number Diff line number Diff line change
@@ -68,6 +68,13 @@ object Settings {
}
}

def nonunitStatements(conf: TaskKey[_]*) = conf.map { c =>
c / scalacOptions ++= {
val version = CrossVersion.partialVersion(scalaVersion.value).get
cond(version._1 == 3, "-Wnonunit-statement")
}
}

def explicitNulls(conf: Configuration*) = conf.map { c =>
c / scalacOptions ++= {
val version = CrossVersion.partialVersion(scalaVersion.value).get
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.0"

// scalanative
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.14")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.15")

// crossbuilding
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
@@ -20,5 +20,5 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

// tooling
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.5")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6")
addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta42")

0 comments on commit d12ee72

Please sign in to comment.