Skip to content

Commit

Permalink
introduce spotless as code linter
Browse files Browse the repository at this point in the history
  • Loading branch information
suside committed Feb 3, 2022
1 parent 33be05a commit 58d3cbd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run Compile Tests
run: ./gradlew assembleRelease
run: ./gradlew spotlessCheck assembleRelease
- name: Run Unit Tests
run: ./gradlew :app:testProdReleaseUnitTest :wear:testProdReleaseUnitTest
- name: Check Output
Expand Down
17 changes: 17 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ buildscript {
}
}
}
plugins {
id "com.diffplug.spotless" version "6.2.1"
}

apply plugin: 'com.android.application'
apply from: 'token-replace.gradle'

Expand Down Expand Up @@ -425,3 +429,16 @@ tasks.withType(Test) {
}

apply plugin: 'com.google.gms.google-services'

spotless {
// limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/master'

java {
target 'src/*/java/**/*.java'
removeUnusedImports()

// You are running Spotless on JVM 8, which limits you to google-java-format 1.7.
googleJavaFormat('1.7').aosp()
}
}

0 comments on commit 58d3cbd

Please sign in to comment.