Fix arc lint's clang-format rule: only format the file we were asked to format.

This avoids diffs being applied in the work tree to files that are
supposed to be excluded (clang tests), allows arc to properly provide
interactive feedback for the formatting fixes, and reduces the number of
files that we format, in a change affecting N files, from N^2 to N.
This commit is contained in:
Richard Smith 2020-10-11 14:20:01 -07:00
parent a9cefc3dee
commit c25da4b04a
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ trap 'cleanup' INT HUP QUIT TERM EXIT
# because whether/how these are installed differs between distributions,
# and we have an executable copy in the tree anyway.
arc_base_commit=$(arc which --show-base)
git diff-index -U0 "${arc_base_commit}" \
git diff-index -U0 "${arc_base_commit}" "${src_file}" \
| clang/tools/clang-format/clang-format-diff.py -style file -i -p1
cp -p "${src_file}" "${formatted_file}"