Files
alfresco-community-repo/scripts/hooks/check-format-and-headers.sh
Tom Page 3f2f654ac9 Add precommit for secret scanning, formatting and license header checking. (#2938)
* Add precommit for secret scanning, formatting and license header checking.

* Turn off bash debug logging.

* Skip precommit checks that apply to all files.

There are too many violations to run against all files.

(cherry picked from commit b00e11cb6f)
2024-10-07 11:53:26 +01:00

22 lines
464 B
Bash
Executable File

#!/usr/bin/env bash
set +x
if [[ -z ${GITHUB_MODIFIED_FILES} ]]
then
modified_files=$(git diff --cached --name-only --diff-filter=ACMR)
else
modified_files=${GITHUB_MODIFIED_FILES}
fi
include_list=""
for file in ${modified_files}
do
include_list="${include_list},${file}"
done
include_list=${include_list:1}
mvn spotless:apply validate -DlicenseUpdateHeaders=true -Pags,all-tas-tests -Dspotless-include-list="${include_list}" > /dev/null || true
set -x