blob: a5baf902e6fe4f97d7885a9d4081d61fc0e555a2 [file] [log] [blame] [edit]
# Per-project `repo upload` hook settings.
# https://chromium.googlesource.com/chromiumos/repohooks/
[Hook Scripts]
# Make cros format do nothing, add two custom checks for
# black and isort.
cros format = echo
black = bash -c 'RV=0; for file in ${PRESUBMIT_FILES}; do if [[ $file == *.py || `head -n1 $file | grep -e "/env python"` ]]; \
then if ! black --check $file; then RV=1; fi; fi done; exit $RV'
isort = bash -c 'RV=0; for file in ${PRESUBMIT_FILES}; do if [[ $file == *.py || `head -n1 $file | grep -e "/env python"` ]]; \
then if ! isort -c $file; then RV=1; fi; fi done; exit $RV'
[Hook Overrides]