Skip to content

Commit

Permalink
Fix configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrohdezma committed Sep 4, 2021
1 parent 68f3f65 commit 37aa092
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ newlines.topLevelStatementBlankLines = [
{
blanks = 1,
minBreaks = 0,
regex = "^(?!Defn\\.Object)"
regex = "^(?!((Term\\.Apply)|(Defn\\.Object)))"
}
]

Expand All @@ -30,6 +30,7 @@ assumeStandardLibraryStripMargin = true

# Align everything that can be aligned
align.preset = most
align.multiline = false
align.tokens."+" = [
{
code = ":=", owner = "Term.ApplyInfix"
Expand Down
10 changes: 3 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
ThisBuild / scalaVersion := "2.12.12"

ThisBuild / organization := "com.alejandrohdezma"

ThisBuild / scalaVersion := "2.12.12"
ThisBuild / organization := "com.alejandrohdezma"
ThisBuild / pluginCrossBuild / sbtVersion := "1.2.8"

addCommandAlias("ci-test", "fix --check; mdoc; scripted")

addCommandAlias("ci-docs", "github; mdoc; headerCreateAll")

addCommandAlias("ci-publish", "github; ci-release")

lazy val scalafmt = "org.scalameta" % "sbt-scalafmt" % "[2.0.0,)" % Provided // scala-steward:off

lazy val documentation = project
lazy val documentation = project
.enablePlugins(MdocPlugin)
.settings(mdocOut := file("."))
.settings(mdocVariables += "SCALAFMT_CONF" -> IO.read(file(".scalafmt.conf")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object SbtScalafmtDefaults extends AutoPlugin {
override def globalSettings: Seq[Def.Setting[_]] =
Seq(
scalafmtOnCompile := !sys.env.contains("CI"),
onLoad := onLoad.value.andThen { state =>
onLoad := onLoad.value.andThen { state =>
val defaults = Source.fromResource(".scalafmt.conf", getClass.getClassLoader).mkString
IO.write(file(".scalafmt.conf"), defaults)

Expand Down
3 changes: 1 addition & 2 deletions project/dependencies.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// For using the plugin in its own build

unmanagedSourceDirectories in Compile +=
baseDirectory.in(ThisBuild).value.getParentFile / "modules" / "sbt-scalafmt-defaults" / "src" / "main" / "scala"

unmanagedResources in Compile +=
unmanagedResources in Compile +=
baseDirectory.in(ThisBuild).value.getParentFile / ".scalafmt.conf"
35 changes: 12 additions & 23 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.30")

addSbtPlugin("com.alejandrohdezma" % "sbt-fix" % "0.7.0")

addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "1.7.6")

addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.9.3")

addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.9.3")

addSbtPlugin("com.alejandrohdezma" % "sbt-modules" % "0.2.0")

addSbtPlugin("com.alejandrohdezma" % "sbt-scalafix-defaults" % "0.6.0")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")

addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.23")

addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.30")
addSbtPlugin("com.alejandrohdezma" % "sbt-fix" % "0.7.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "1.7.6")
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.9.3")
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.9.3")
addSbtPlugin("com.alejandrohdezma" % "sbt-modules" % "0.2.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-scalafix-defaults" % "0.6.0")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.23")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")

0 comments on commit 37aa092

Please sign in to comment.