Skip to content

Commit

Permalink
Fix arc lint's clang-format rule: only format the file we were asked …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
zygoloid committed Oct 11, 2020
1 parent a9cefc3 commit c25da4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/arcanist/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit c25da4b

Please sign in to comment.