-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add .clang-format #143
base: main
Are you sure you want to change the base?
add .clang-format #143
Conversation
This was previously suggested in apertium/apertium-lex-tools#84 and while there are still several open PRs, most of them are mine and have a fair amount of changes that need to be integrated anyway. |
5bcdbfa
to
3edf7c0
Compare
Committed my opinion. In particular:
I "solved" similar issues in CG-3 with https://github.com/GrammarSoft/cg3/blob/main/scripts/clang-format.pl |
I have no bikeshed hills to die on in code formatting issues, but I do have a strong opinion on this, long lines are really unreadable in 90 % of editors, ides (though suggestions for good such visualisations for vim and emacs are welcome) but also diff formats on console or web. Using more than 80 characters in a reasonable (non-java non-xml) language is almost always a sign of a really badly structured code. |
My usual compromise is 120 characters. 80 is just too damn small, imo. |
In which I am mildly opinionated about C++ code formatting.
Not sure if this should go here and get copied to all the other repos or if there's somewhere else it should go.
Anyway, I'm sure someone will disagree with at least one of these settings, so let the bikeshedding begin. :)
Explanation of options: https://clang.llvm.org/docs/ClangFormatStyleOptions.html (I couldn't figure out how to get newer than 10.0 via apt, so I'm ignoring options from more recent versions.)
Version 10 manual: https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html
Working interactive configurator: https://clang-format-configurator.site/