Skip to content

Commit

Permalink
clang-tidy: Return from diff fun if empty diff
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax committed Oct 28, 2021
1 parent 4a2b01f commit 85b4694
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ci/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ function run_clang_tidy() {
}

function run_clang_tidy_diff() {
git diff "$1" | filter_excludes | \
local diff
diff="$(git diff "${1}")"
if [[ -z "$diff" ]]; then
echo "No changes detected, skipping clang_tidy_diff"
return 0
fi
echo "$diff" | filter_excludes | \
python3 "${LLVM_PREFIX}/share/clang/clang-tidy-diff.py" \
-clang-tidy-binary="${CLANG_TIDY}" \
-export-fixes="${FIX_YAML}" -j "${NUM_CPUS:-0}" -p 1 -quiet
Expand Down

0 comments on commit 85b4694

Please sign in to comment.