Skip to content

Commit

Permalink
Fix lint script (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenfengLiu authored Oct 5, 2023
1 parent 4e5784d commit c838b8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/clangformat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function run_copyright_headers() {
# Filter out anything in driver/ folder
# Filter out anything in dive_core/llvm_libs/ folder
# Grep seems to match "(standard input)", filter this out in the for loop output
git diff origin/master HEAD --name-only --| grep "\.${suffix}$" | grep -v "^driver/" | grep -v "^dive_core/llvm_libs/" | grep -v "^capture_layer/gpu_performance_api" | grep -v "^third_party/" | grep -P -v '^grpc_bin/*' | xargs grep -L "Copyright .* Google"
git diff origin/main HEAD --name-only --| grep "\.${suffix}$" | grep -v "^third_party/" | grep -P -v '^prebuild/*' | xargs grep -L "Copyright .* Google"
done | grep -v "(standard input)" > ${tmpfile}
if test -s ${tmpfile}; then
# tempfile is NOT empty
Expand All @@ -64,7 +64,7 @@ function run_copyright_headers() {

function run_clang_format() {
# Use grep negative lookahead to filter out all files that being with 'driver' but does not contain 'dive'
git diff origin/master HEAD --name-only --diff-filter=ACMR --| grep -E "\.(c|cpp|h|hpp)$" | grep -P -v '^driver*((?!dive).)*$' | grep -P -v '^capture_layer/gpu_performance_api'| grep -P -v '^third_party/*' | grep -P -v '^grpc_bin/*' | xargs $CLANG_FORMAT -i -style=file
git diff origin/main HEAD --name-only --diff-filter=ACMR --| grep -E "\.(c|cpp|h|hpp|cc)$" | grep -P -v '^third_party/*' | grep -P -v '^prebuild/*' | xargs $CLANG_FORMAT -i -style=file
}

# Check copyright headers
Expand Down

0 comments on commit c838b8d

Please sign in to comment.