Commit 27922ec
treewide: tighten clang-format config and enforce it in CI
Keep the Google preset as the base and only list deviations. Compared to
the previous config, all the "short X on a single line" options are
disabled so functions, enums, ifs and loops always span multiple lines,
braced lists always break after the opening brace, call arguments are
not allowed to be moved as a whole to the next line, and consecutive
macro definitions are aligned so register maps and lookup tables stay
readable. String literals are never split so log and i18n messages
remain greppable.
Braced initializer members are indented by two columns and trailing
comments are separated by a single space, matching the prevailing
style of the existing sources.
Options that are already Google defaults (IndentWidth, UseTab) are
dropped. BreakAfterOpenBracketBracedList/BreakBeforeCloseBracketBracedList
require clang-format 22, which is what the CI action runs.
Template sources, generated bitmap data headers, the clar test framework
and the test fixtures are excluded from formatting via
.clang-format-ignore. The fixtures are captured data that some tests
parse as text at runtime, so their layout must not change.
Co-authored-by: Nick Schonning <nschonni@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>1 parent 061a317 commit 27922ec
3 files changed
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
| 4 | + | |
7 | 5 | | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
0 commit comments