Remove javafmtOnCompile and check in CI
This commit is contained in:
parent
617ca6a444
commit
c18a81a243
3 changed files with 29 additions and 6 deletions
26
.github/workflows/build-test-prValidation.yml
vendored
26
.github/workflows/build-test-prValidation.yml
vendored
|
|
@ -11,6 +11,32 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
check-code-style:
|
||||||
|
name: Check / Code Style
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3.1.0
|
||||||
|
with:
|
||||||
|
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Cache Coursier cache
|
||||||
|
uses: coursier/cache-action@v6.4.0
|
||||||
|
|
||||||
|
- name: Setup Java 8
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 8
|
||||||
|
|
||||||
|
- name: Code style check
|
||||||
|
run: |-
|
||||||
|
cp .jvmopts-ci .jvmopts
|
||||||
|
sbt \
|
||||||
|
-Dsbt.override.build.repos=false \
|
||||||
|
-Dsbt.log.noformat=false \
|
||||||
|
javafmtCheckAll
|
||||||
pull-request-validation:
|
pull-request-validation:
|
||||||
name: Check / Tests
|
name: Check / Tests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ enablePlugins(
|
||||||
JavaFormatterPlugin)
|
JavaFormatterPlugin)
|
||||||
disablePlugins(MimaPlugin)
|
disablePlugins(MimaPlugin)
|
||||||
|
|
||||||
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; headerCheckAll")
|
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; javafmtCheckAll; headerCheckAll")
|
||||||
addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbt")
|
addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbt; javafmtAll")
|
||||||
|
|
||||||
addCommandAlias(
|
addCommandAlias(
|
||||||
name = "fixall",
|
name = "fixall",
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ object JavaFormatter extends AutoPlugin {
|
||||||
private val ignoreConfigFileName: String = ".sbt-java-formatter.conf"
|
private val ignoreConfigFileName: String = ".sbt-java-formatter.conf"
|
||||||
private val descriptor: String = "sbt-java-formatter"
|
private val descriptor: String = "sbt-java-formatter"
|
||||||
|
|
||||||
private val formatOnCompile = !sys.props.contains("pekko.no.discipline")
|
|
||||||
|
|
||||||
import JavaFormatterPlugin.autoImport._
|
import JavaFormatterPlugin.autoImport._
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
import sbt._
|
import sbt._
|
||||||
|
|
@ -38,6 +36,5 @@ object JavaFormatter extends AutoPlugin {
|
||||||
new ProjectFileIgnoreSupport((ThisBuild / baseDirectory).value / ignoreConfigFileName, descriptor)
|
new ProjectFileIgnoreSupport((ThisBuild / baseDirectory).value / ignoreConfigFileName, descriptor)
|
||||||
val simpleFileFilter = new SimpleFileFilter(file => ignoreSupport.isIgnoredByFileOrPackages(file))
|
val simpleFileFilter = new SimpleFileFilter(file => ignoreSupport.isIgnoredByFileOrPackages(file))
|
||||||
simpleFileFilter || (javafmt / excludeFilter).value
|
simpleFileFilter || (javafmt / excludeFilter).value
|
||||||
},
|
})
|
||||||
javafmtOnCompile := formatOnCompile)
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue