Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add clang-format #1701
This is an attempt to fix #1692.
(I think) you can reproduce most of this PR by:
It also adds onto the end of the script that the Linux CI uses to check if running
jackgerrits left a comment
I would like to see some small changes around alignment. I'm going to block this PR because we need the refactor change merged before this otherwise the conflicts will be terrible.
I made a change to the
Jan 4, 2019
I took a look through. The patch seems definitely worth doing although we might want to make some tweaks around the edges. Can you take a look at the questions I had?
It's probably also worthwhile stick this:
I guess it's clearer to me if something which is conceptually a 'line' (multiple initializers, multiple option modifiers) stays on a conceptual 'line' rather than having a discontinuous shift in format.
This does seem pretty subjective, so I think the question is: does that convince either of you? Or does anyone else care?
Unrelated, there's a build fail here that we need to fix before merging.
My (probably strange) opinion is that the value of the code formatter does not come from making the code more readable, but from making some style (even if it's slightly or completely different from the pre-existing style) automatically and consistently applicable.
That is, I'm okay with (and to some degree, expect) the code getting slightly uglier.
Reading through clang-format docs, it looks like we want:
The logic here is that the format is a little bit more consistent and concise.
Do you want to do it? (I'll merge immediately to avoid having things drag on further...)
I guess if you merge master and format all the files it should be okay, but merging without re-formatting may cause the CI check to fail.
I also wanted to test the CI check more thoroughly and add the script to easily reformat everything under