Skip to content

Commit c25da4b

Browse files
committed
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.
1 parent a9cefc3 commit c25da4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/arcanist/clang-format.sh

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

5858
cp -p "${src_file}" "${formatted_file}"

0 commit comments

Comments
 (0)