Commit 23b982d
authored
Simplify swift-format soundness script (#108)
### Motivation
The `run-swift-format.sh` script run as part of soundness explicitly
lists the directories to format. This is to avoid running `swift-format`
on the contents of `.build/` which contains a checkouts of all the
dependencies. This isn't necessary, as we can use Git to tell us what
files need to be formatted, which can also make for a more robust
script/command as we add new directories.
Additionally, with the previous strategy, `Package.swift` at the root of
the repository was ignored. This was deliberate, but in hindsight I
don't think the lack of trailing comma enforcement is worth us excluding
it.
### Modifications
- Use `git ls-files` to determine which files need to be passed to
`swift-format`.
### Result
- Script is simpler (also easier to add a one-shot command as a
pre-commit hook).
- Package.swift is also formatted.
### Test Plan
None.1 parent fe76c0d commit 23b982d
2 files changed
+7
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 26 | + | |
| 27 | + | |
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
40 | | - | |
| 35 | + | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
| |||
0 commit comments