Open asmaloney opened 1 year ago
I don't have a .clang-format
- it would be great to create one that matches the existing style if possible
In my experience it will be tricky to match your style 100%.
If you're willing to compromise on a few things I believe getting code formatting automated and out of the way is a win for any project.
I'll work on it to see how close I can get to the existing code then you can assess it and tweak it if you like.
I think I've seen a tool that can analyse a codebase and try to generate .clang-format
that is very close to the existing style. I might be wrong though
I've tried a couple with not-so-great results, but maybe I haven't found the right one yet.
The tricky thing is that clang-format options are complicated and amended frequently. C++ formatting is a mess and has caused so many wasted hours (and bugs) - I like go's approach with gofmt
! 😄
It would be useful when making larger changes (like this) if it could be properly formatted using clang-format.
Do you happen to have a
.clang-format
file you can drop into the repo?