[build] Enable spotbugs (#3601)

Benign spotbugs warnings were suppressed, and all others were fixed. Bug
descriptions are documented here:
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html

Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
Tyler Veness
2021-09-24 16:04:02 -07:00
committed by GitHub
parent b65fce86bf
commit 95dd20a151
73 changed files with 356 additions and 558 deletions

View File

@@ -69,29 +69,8 @@ jobs:
run: wpiformat -list-changed-files
- name: Run clang-tidy
run: wpiformat -clang 12 -no-format -tidy-changed -compile-commands=build/compile_commands/linuxx86-64 -vv
spotless:
name: "Spotless"
runs-on: ubuntu-latest
container: wpilib/ubuntu-base:18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run spotless
run: ./gradlew spotlessCheck
- name: Apply Spotless
run: ./gradlew :spotlessApply
if: ${{ failure() }}
- name: Generate diff
run: git diff HEAD > spotless-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v2
with:
name: spotless fixes
path: spotless-fixes.patch
if: ${{ failure() }}
javaformat:
name: "Checkstyle and PMD"
name: "Java format"
runs-on: ubuntu-latest
container: wpilib/ubuntu-base:18.04
steps:
@@ -99,4 +78,9 @@ jobs:
with:
fetch-depth: 0
- name: Run Java format
run: ./gradlew javaFormat
run: ./gradlew javaFormat spotbugsMain spotbugsTest spotbugsDev
- name: Check output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > javaformat-fixes.patch
if: ${{ failure() }}