Skip to content

Commit

Permalink
chore: add mechanism to skip lint on some java files
Browse files Browse the repository at this point in the history
  • Loading branch information
myyk committed Nov 8, 2024
1 parent ed4cf47 commit 99194b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ jobs:
env-bridge-versions: 'essential'

# Scalafmt, Mima, and Scalafix job runs last because it's the least important:
# usually just a automated or mechanical manual fix to do before merging
# usually just an automated or mechanical manual fix to do before merging
lint-autofix:
needs: build-linux
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '11'
buildcmd: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources && ./mill -i __.mimaReportBinaryIssues && ./mill -i __.fix --check && ./mill -i mill.javalib.palantirformat.PalantirFormatModule/ --check __.javaSources
buildcmd: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources && ./mill -i __.mimaReportBinaryIssues && ./mill -i __.fix --check && ./mill -i mill.javalib.palantirformat.PalantirFormatModule/ --check __.lintableJavaSources
6 changes: 6 additions & 0 deletions example/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@ object `package` extends RootModule with Module {

def javaSources = Task.Sources {
os.walk(super.testRepoRoot().path)
.filterNot(_.toString.contains("linting"))
.filter(_.ext == "java")
.map(PathRef(_))
}

def lintableJavaSources = Task.Sources {
// PalantirFormat doesn't give us any abilities to configure it, so we can do a rough filtering of files we want to skip
javaSources().filterNot(_.toString.contains("linting"))
}

def resources = upstreamOpt match {
case None => T{ Seq(super.testRepoRoot()) }
case Some(upstream) => T{
Expand Down

0 comments on commit 99194b5

Please # to comment.