Introduce apply-error-prone-suggestions.sh (#171)

This script compiles the code using Error Prone and applies its suggestions. 
The set of checks applied can optionally be restricted by name.
This commit is contained in:
Stephan Schroevers
2022-08-03 17:05:38 +02:00
committed by GitHub
parent 9055dfff19
commit 336557cf8e

View File

@@ -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