Skip to content

Commit c4a84b5

Browse files
committed
chore(ci): add check for formatting in CI
This also adds in a .git-blame-ignore-revs file for the commit that formats everything.
1 parent b049841 commit c4a84b5

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Format the codebase for the first time
2+
b049841d5707d5bd87be516d8cda7be2a7585eae

.github/workflows/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ jobs:
4949

5050
- run: ./mill -i -k __.mimaReportBinaryIssues
5151

52+
check-formatting:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v3
56+
with:
57+
fetch-depth: 0
58+
59+
- uses: actions/setup-java@v3
60+
with:
61+
distribution: 'temurin'
62+
java-version: 8
63+
64+
- run: ./mill -i -k __.checkFormat
65+
5266
publish-sonatype:
5367
if: github.repository == 'com-lihaoyi/os-lib' && contains(github.ref, 'refs/tags/')
5468
needs: test

build.sc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import $ivy.`com.github.lolgab::mill-mima::0.0.13`
66
import mill._
77
import mill.define.{Task, Target}
88
import mill.scalalib._
9+
import mill.scalalib.scalafmt._
910
import mill.scalanativelib._
1011
import mill.scalalib.publish._
1112
import mill.scalalib.api.ZincWorkerUtil
@@ -124,7 +125,8 @@ trait SafeDeps extends ScalaModule {
124125
}
125126
}
126127

127-
trait OsLibModule extends CrossScalaModule with PublishModule with AcyclicModule with SafeDeps {
128+
trait OsLibModule extends CrossScalaModule with PublishModule with AcyclicModule with SafeDeps
129+
with ScalafmtModule {
128130
def publishVersion = VcsVersion.vcsState().format()
129131
def pomSettings = PomSettings(
130132
description = artifactName(),

0 commit comments

Comments
 (0)