Skip to content

Commit

Permalink
Replace scalafmtOnCompile with CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Nov 3, 2024
1 parent 55893d3 commit 30584d5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
if: ${{ matrix.jobtype == 1 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF8 scalafmtCheckAll +test +packagedArtifacts
sbt -v -Dfile.encoding=UTF8 +test +packagedArtifacts
23 changes: 23 additions & 0 deletions .github/workflows/format.yml
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@v3
with:
arguments: '--list'
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.7.4
version = 3.8.3
maxColumn = 100
project.git = true
project.excludeFilters = [ /sbt-test/, /input_sources/, /contraband-scala/ ]
Expand Down
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ ThisBuild / scmInfo := {
Some(ScmInfo(url(s"https://github.com/$slug"), s"git@github.com:$slug.git"))
}
ThisBuild / licenses := List(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")))
ThisBuild / scalafmtOnCompile := true
ThisBuild / developers := List(
Developer("harrah", "Mark Harrah", "@harrah", url("https://github.com/harrah")),
Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("http://eed3si9n.com/")),
Expand Down Expand Up @@ -67,8 +66,6 @@ def commonSettings: Seq[Setting[_]] = Def.settings(
inCompileAndTest(
(console / scalacOptions) --= Vector("-Ywarn-unused-import", "-Ywarn-unused", "-Xlint")
),
scalafmtOnCompile := true,
Test / scalafmtOnCompile := true,
Compile / publishArtifact := true,
Test / publishArtifact := false,
Test / parallelExecution := false
Expand Down

0 comments on commit 30584d5

Please sign in to comment.