Add code formatting checker and enforcement in CI
Compare changes
Files
245
Conflict: This file was added both in the source and target branches, but with different contents.
Ask someone with write access to resolve it.
.clang-format
0 → 100644
+ 156
− 0
What are the changes to the default Google style?
Might be easier for coding guidelines to use the Google style directly.
Right now the changes are (by diffing with respect to the output of
clang-format --style=Google --dump-config
):AccessModifierOffset
: labRemote =-1
, google =-3
BraceWrapping:BeforeElse
: labRemote =false
, google =true
IndentWidth
: labRemote =4
, google =2
Pretty sure indent widths of 4 are the sweet spot for
C++
/OOP across several reviews I've read: more separable/readable code blocks but discouraging high code complexity/nesting (since you run up against the column width at just the right rate, as compared to indent widths of 2).I'm ambivalent towards the
BraceWrapping
.The
AccessModifierOffset
refers to the indentation (relative to theIndentWidth
) on classes. That is, the spacing requirement of thepublic
,private
,protected
keywords. For example, anAccessModifierOffset
of-1
(andIndentWidth
= 4) is:vs
AccessModifierOffset
of-3
(andIndentWidth
= 4) is:I'm also pretty ambivalent towards the precise value of this, though I do find that it makes sense that there be some offset (i.e.
offset < 0
as opposed tooffset = 0
).