Commit e1db23f
authored
clang-format: Use config directly instead of modifying repository [AP-3053] (#146)
The clang-format logic relied on copying the config file into the repo
root, which pollutes the repository and might fail if there is already a
symlink. This change modifies the logic to directly pass the config
location to the `clang-format` CLI.
Tested in `starling-core`:
```
bazel run @rules_swiftnav//clang_format
INFO: Analyzed target @rules_swiftnav//clang_format:clang_format (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target @rules_swiftnav//clang_format:clang_format up-to-date:
bazel-bin/external/rules_swiftnav/clang_format/clang_format
INFO: Elapsed time: 0.255s, Critical Path: 0.12s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/external/rules_swiftnav/clang_format/clang_format format_diff external/aarch64-darwin-llvm/bin/clang-format external/rules_swiftnav/clang_format/.clang-format
```1 parent 2deb089 commit e1db23f
1 file changed
+10
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
15 | 11 | | |
16 | | - | |
| 12 | + | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
| 16 | + | |
21 | 17 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 18 | + | |
27 | 19 | | |
28 | | - | |
29 | | - | |
| 20 | + | |
| 21 | + | |
30 | 22 | | |
31 | 23 | | |
32 | 24 | | |
| |||
36 | 28 | | |
37 | 29 | | |
38 | 30 | | |
39 | | - | |
| 31 | + | |
40 | 32 | | |
41 | 33 | | |
42 | | - | |
| 34 | + | |
43 | 35 | | |
44 | 36 | | |
45 | 37 | | |
46 | | - | |
| 38 | + | |
47 | 39 | | |
48 | 40 | | |
49 | 41 | | |
| |||
0 commit comments