-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from eed3si9n/wip/scalafmt
ci: Scalafmt
- Loading branch information
Showing
6 changed files
with
349 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Scalafmt | ||
|
||
permissions: {} | ||
|
||
on: | ||
pull_request: | ||
branches: ['**'] | ||
|
||
jobs: | ||
build: | ||
name: Code is formatted | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout current branch (full) | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Check project is formatted | ||
uses: jrouly/scalafmt-native-action@v4 | ||
with: | ||
arguments: '--list' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version = 3.8.3 | ||
runner.dialect = scala212 | ||
maxColumn = 120 | ||
project.git = true | ||
|
||
# http://docs.scala-lang.org/style/scaladoc.html recommends the JavaDoc style. | ||
# scala/scala is written that way too https://github.com/scala/scala/blob/v2.12.2/src/library/scala/Predef.scala | ||
docstrings.style = Asterisk | ||
|
||
# This also seems more idiomatic to include whitespace in import x.{ yyy } | ||
spaces.inImportCurlyBraces = true | ||
|
||
rewrite.trailingCommas.style = keep | ||
|
||
align.tokens."+" = [ | ||
{ | ||
code = "%" | ||
owners = [ | ||
{ regex = "Term.ApplyInfix" } | ||
] | ||
}, | ||
{ | ||
code = "%%" | ||
owners = [ | ||
{ regex = "Term.ApplyInfix" } | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,42 +8,51 @@ ThisBuild / version := { | |
"9.0.0-SNAPSHOT" | ||
} else orig | ||
} | ||
lazy val root = (project in file (".")) | ||
.enablePlugins(SbtPlugin) | ||
.settings( | ||
name := "flyway-sbt", | ||
libraryDependencies ++= Seq( | ||
"org.flywaydb" % "flyway-core" % flywayVersion | ||
), | ||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfuture" | ||
), | ||
pluginCrossBuild / sbtVersion := { | ||
scalaBinaryVersion.value match { | ||
case "2.12" => "1.5.8" | ||
case _ => "2.0.0-M2" | ||
} | ||
}, | ||
Compile / doc / scalacOptions ++= { | ||
Seq( | ||
"-sourcepath", | ||
(LocalRootProject / baseDirectory).value.getAbsolutePath, | ||
"-doc-source-url", | ||
s"""https://github.com/sbt/flyway-sbt/tree/${sys.process.Process("git rev-parse HEAD").lineStream_!.head}€{FILE_PATH}.scala""" | ||
) | ||
}, | ||
scriptedLaunchOpts := { scriptedLaunchOpts.value ++ | ||
lazy val root = (project in file(".")) | ||
.enablePlugins(SbtPlugin) | ||
.settings( | ||
name := "flyway-sbt", | ||
libraryDependencies ++= Seq( | ||
"org.flywaydb" % "flyway-core" % flywayVersion | ||
), | ||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfuture" | ||
), | ||
pluginCrossBuild / sbtVersion := { | ||
scalaBinaryVersion.value match { | ||
case "2.12" => "1.5.8" | ||
case _ => "2.0.0-M2" | ||
} | ||
}, | ||
Compile / doc / scalacOptions ++= { | ||
Seq( | ||
"-sourcepath", | ||
(LocalRootProject / baseDirectory).value.getAbsolutePath, | ||
"-doc-source-url", | ||
s"""https://github.com/sbt/flyway-sbt/tree/${sys.process | ||
.Process("git rev-parse HEAD") | ||
.lineStream_! | ||
.head}€{FILE_PATH}.scala""" | ||
) | ||
}, | ||
scriptedLaunchOpts := { | ||
scriptedLaunchOpts.value ++ | ||
Seq("-Xmx1024M", "-Dplugin.version=" + version.value) | ||
}, | ||
scriptedBufferLog := false, | ||
publishMavenStyle := true, | ||
}, | ||
scriptedBufferLog := false, | ||
publishMavenStyle := true, | ||
) | ||
|
||
ThisBuild / description := "An sbt plugin for Flyway database migration" | ||
ThisBuild / developers := List( | ||
Developer(id="davidmweber", name="David Weber", email="[email protected]", url=url("https://davidmweber.github.io/flyway-sbt-docs/")) | ||
Developer( | ||
id = "davidmweber", | ||
name = "David Weber", | ||
email = "[email protected]", | ||
url = url("https://davidmweber.github.io/flyway-sbt-docs/") | ||
) | ||
) | ||
ThisBuild / licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")) | ||
ThisBuild / scmInfo := Some( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0") | ||
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.24.0") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") |
Oops, something went wrong.