-
-
Notifications
You must be signed in to change notification settings - Fork 33
Use clang-format on entire code base
#120
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
Conversation
|
pls rebase. and we should sync the openage clang-format config to the nyan repo while we're at it :) |
6a99cdf to
2cd2653
Compare
done |
TheJJ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, before we push this, we should have another attempt to tame the formatting more. some formatting is now worse than before.
| std::ostringstream builder; | ||
| builder << msg << ": " | ||
| << token_type_str(token.get_type()); | ||
| << token_type_str(token.get_type()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm this is incorrect now - i thought clang-format was able to mix indentation and alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that because << is technically a line continuation? The documentation says:
UT_AlignWithSpaces(in configuration:AlignWithSpaces) Use tabs for line continuation and indentation, and spaces for alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a line continuation that should align to the previous <<. i thought we found a solution for this already to format correctly.
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignoperands
but it seems to be weird anyway, even with always-tab (which we don't have):
llvm/llvm-project#59797
2cd2653 to
1fd77e7
Compare
TheJJ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stream operation continuations are now non-aligned, but i can live with it.
the function chain calls are really messed up though. i've created llvm/llvm-project#114538 because this seems like a bug in clang-format.
we should manually fix them, it's not many places it seems.
|
Should I revert the changes that you mentioned for now? I don't think clang will solve them very soon. We can wrap these code parts in |
|
yea that may be a workaround until there's a fix |
1fd77e7 to
baaf371
Compare
baaf371 to
23a9304
Compare
|
I did a few ther changes to avoid having to use |
|
great, good to go now! |
We use a
.clang-formatfile for our code style but most code in the repo does not adhere to this style. This PR changes that.Depends on #119