Remove javafmtOnCompile and check in CI

This commit is contained in:
Matthew de Detrich 2023-08-01 09:47:22 +02:00 committed by Matthew de Detrich
parent 617ca6a444
commit c18a81a243
3 changed files with 29 additions and 6 deletions

View file

@ -11,6 +11,32 @@ concurrency:
cancel-in-progress: true
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:
name: Check / Tests
runs-on: ubuntu-20.04

View file

@ -37,8 +37,8 @@ enablePlugins(
JavaFormatterPlugin)
disablePlugins(MimaPlugin)
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; headerCheckAll")
addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbt")
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; javafmtCheckAll; headerCheckAll")
addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbt; javafmtAll")
addCommandAlias(
name = "fixall",

View file

@ -23,8 +23,6 @@ object JavaFormatter extends AutoPlugin {
private val ignoreConfigFileName: String = ".sbt-java-formatter.conf"
private val descriptor: String = "sbt-java-formatter"
private val formatOnCompile = !sys.props.contains("pekko.no.discipline")
import JavaFormatterPlugin.autoImport._
import sbt.Keys._
import sbt._
@ -38,6 +36,5 @@ object JavaFormatter extends AutoPlugin {
new ProjectFileIgnoreSupport((ThisBuild / baseDirectory).value / ignoreConfigFileName, descriptor)
val simpleFileFilter = new SimpleFileFilter(file => ignoreSupport.isIgnoredByFileOrPackages(file))
simpleFileFilter || (javafmt / excludeFilter).value
},
javafmtOnCompile := formatOnCompile)
})
}