Skip to content

Commit 71597e0

Browse files
committed
wip scalafix
1 parent 2b01cf1 commit 71597e0

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.github/workflows/build.yml

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

5252
- run: ./mill -i "__.test" + generateTutorial + generateReference && git diff --exit-code
5353

54+
check-scalafix:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
61+
- uses: actions/setup-java@v3
62+
with:
63+
distribution: 'temurin'
64+
java-version: 17
65+
66+
- run: ./mill -i __.fix && git diff --exit-code
67+
5468
publish-sonatype:
5569
if: github.repository == 'com-lihaoyi/scalasql' && contains(github.ref, 'refs/tags/')
5670
needs: test

.scalafix.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RemoveUnused.imports = true

build.sc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import $file.docs.generateDocs
22
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
33
import $ivy.`com.github.lolgab::mill-mima::0.1.0`
4+
import $ivy.`com.goyeau::mill-scalafix::0.3.1`
45
import de.tobiasroeser.mill.vcs.version.VcsVersion
5-
6+
import com.goyeau.mill.scalafix.ScalafixModule
67
import mill._, scalalib._, publish._
78

89
val scalaVersions = Seq("2.13.12"/*, "3.3.1"*/)
910

10-
trait Common extends CrossScalaModule with PublishModule{
11+
trait Common extends CrossScalaModule with PublishModule with ScalafixModule{
1112
def scalaVersion = crossScalaVersion
1213

1314
def publishVersion = VcsVersion.vcsState().format()
@@ -25,6 +26,8 @@ trait Common extends CrossScalaModule with PublishModule{
2526
Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")
2627
)
2728
)
29+
30+
def scalacOptions = Seq("-Wunused")
2831
}
2932

3033

@@ -41,7 +44,8 @@ trait ScalaSql extends Common{
4144
)
4245

4346

44-
object test extends ScalaTests {
47+
object test extends ScalaTests with ScalafixModule{
48+
def scalacOptions = Seq("-Wunused")
4549
def ivyDeps = Agg(
4650
ivy"com.github.vertical-blank:sql-formatter:2.0.4",
4751
ivy"com.lihaoyi::mainargs:0.4.0",

0 commit comments

Comments
 (0)