Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
Use 'set -xo pipefail' instead (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnek authored Sep 14, 2023
1 parent 6f4a488 commit 98ee368
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions Testing/lint.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
#!/bin/bash
set -xo pipefail

function main() {
GIT_ROOT=$(git rev-parse --show-toplevel)
err=0
GIT_ROOT=$(git rev-parse --show-toplevel)

find $GIT_ROOT \( -name "*.m" -o -name "*.h" -o -name "*.mm" -o -name "*.cc" \) -exec clang-format --Werror --dry-run {} \+
err="$(( $err | $? ))"
find $GIT_ROOT \( -name "*.m" -o -name "*.h" -o -name "*.mm" -o -name "*.cc" \) -exec clang-format --Werror --dry-run {} \+

! git grep -EIn $'[ \t]+$' -- ':(exclude)*.patch'
err="$(( $err | $? ))"
! git grep -EIn $'[ \t]+$' -- ':(exclude)*.patch'

go install github.com/bazelbuild/buildtools/buildifier@latest
~/go/bin/buildifier --lint=warn -r $GIT_ROOT
err="$(( $err | $? ))"
go install github.com/bazelbuild/buildtools/buildifier@latest
~/go/bin/buildifier --lint=warn -r $GIT_ROOT

python3 -m pip install -q pylint
find $GIT_ROOT \( -name "*.py" \) -exec python3 -m pylint --score n --rcfile=$GIT_ROOT/.pylintrc {} \+
err="$(( $err | $? ))"

return $err
}

main $@
exit $?
python3 -m pip install -q pylint
find $GIT_ROOT \( -name "*.py" \) -exec python3 -m pylint --score n --rcfile=$GIT_ROOT/.pylintrc {} \+

0 comments on commit 98ee368

Please sign in to comment.