diff options
Diffstat (limited to 'PRESUBMIT.sh')
-rwxr-xr-x | PRESUBMIT.sh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/PRESUBMIT.sh b/PRESUBMIT.sh index 9b911ab3..6c4e9009 100755 --- a/PRESUBMIT.sh +++ b/PRESUBMIT.sh @@ -10,7 +10,9 @@ fail=0 function check_clang_format() { - if ! cmp -s <(./clang-format -style=file "$1") "$1"; then + if ! which clang-format &>/dev/null; then + echo "Please add clang-format to your PATH or manually check $1 for format errors." + elif ! cmp -s <(clang-format -style=file "$1") "$1"; then echo "Needs format: $1" fail=1 fi @@ -57,10 +59,6 @@ if [[ "$invoker" != 'python' ]]; then echo "This shouldn't be invoked directly, please use \`git cl presubmit\`." fi -if [[ ! -e ./clang-format ]]; then - tools/install-build-tools.sh -fi - for f in $(git diff --name-only --diff-filter=d origin/master); do # Skip third party files, except our custom BUILD.gns if [[ $f =~ third_party/[^\/]*/src ]]; then |