Skip to content

Commit

Permalink
Introduce apply-error-prone-suggestions.sh (#171)
Browse files Browse the repository at this point in the history
This script compiles the code using Error Prone and applies its suggestions. 
The set of checks applied can optionally be restricted by name.
  • Loading branch information
Stephan202 authored Aug 3, 2022
1 parent 9055dff commit 336557c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions apply-error-prone-suggestions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Compiles the code using Error Prone and applies its suggestions. The set of
# checks applied can optionally be restricted by name.
#
# As this script may modify the project's code, it is important to execute it
# in a clean Git working directory.

set -e -u -o pipefail

if [ "${#}" -gt 1 ]; then
echo "Usage: ./$(basename "${0}") [PatchChecks]"
exit 1
fi

patchChecks=${1:-}

mvn clean test-compile fmt:format \
-T 1.0C \
-Perror-prone \
-Perror-prone-fork \
-Ppatch \
-Pself-check \
-Derror-prone.patch-checks="${patchChecks}" \
-Dverification.skip

0 comments on commit 336557c

Please sign in to comment.