Closed claremacrae closed 4 years ago
Here is @alastairUK's suggested file, renamed to allow me to upload it here:
I had a go at applying a format in this branch https://github.com/alastairUK/ApprovalTests.cpp/tree/clang-format
I think it looks OK. I used your clang-format with the changes in this commit:
https://github.com/alastairUK/ApprovalTests.cpp/commit/db76013964a6ab440561933f957ac8a12fed55e6
There were a couple of issues after sorting the includes but I believe the fixes are obvious.
Have also added a github action to apply clang-format after a push. It will fail if changes detected. It can likely be merged into the build action at some point...
Thanks for this - really helpful.
On one project I added clang-format validation to CI, so I can be sure that every PR is compliant. Here's how: https://github.com/JayBazuzi/Okra/blob/master/.travis.yml
Thanks Jay, that's really helpful - I learned some sh/bash stuff too...
https://github.com/alastairUK/ApprovalTests.cpp/commit/7d5b45955617e6b1adda7d4d1b4ebd1757939758
This was my (poor) attempt to do this. I think it can likely be added to:
To do this step after running the various build (or perhaps before?)
It should fail if there are any formatting issues (at least on my tests I did)
It would be handy to show the formatting changes needed in the (failing) pull request (for instance) but no idea how to do that!
This is useful for experimenting with clang format settings: https://zed0.co.uk/clang-format-configurator/
@dheater is kindly going to take a look at this!
We have a style guide of sorts:
https://github.com/approvals/ApprovalTests.cpp/blob/master/tests/Catch2_Tests/StyleGuide.h
But nothing to help us keep the formatting consistent...
In another project, I set up a .clang-format file to try to match the Style Guide.. https://github.com/claremacrae/ApprovalTests.cpp.Nursery/blob/master/.clang-format
In particular, as we increase the use of namespaces, e.g. in #34, I would like them to be indented so that namespace nesting can be spotted at a glance...
I know that @alastairUK has similarly been experimenting with this, and preferred not limiting the line length.
This is one of those things where any style definition is going to be better than having something inconsistent...
I would hold off implementing this until all the current PRs and open branches on forks have been resolved, though.