-
Notifications
You must be signed in to change notification settings - Fork 595
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
clang-format: set ColumnLimit to 0 and reformat #1045
base: unstable
Are you sure you want to change the base?
Conversation
This commit hopefully improves the formatting of the codebase by setting ColumnLimit to 0 and hence stopping clang-format from trying to put as much stuff in one line as possible. This change enabled us to remove most of `clang-format off` directives and fixed a bunch of lines that looked like this: ```c \#define KEY \ VALUE /* comment */ ``` Additionally, one pair of `clang-format off` / `clang-format on` had `clang-format off` as the second comment and hence didn't enable the formatting for the rest of the file. This commit addresses this issue as well. Signed-off-by: Mikhail Koviazin <mikhail.koviazin@aiven.io>
fb494f4
to
a996239
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1045 +/- ##
============================================
+ Coverage 70.62% 70.64% +0.01%
============================================
Files 114 114
Lines 61672 61682 +10
============================================
+ Hits 43555 43574 +19
+ Misses 18117 18108 -9
|
Nice. |
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.
IMO this makes clang-format much less annoying. It lets us remove the /* clang-format off */
which is a good indication that it respects our style better.
ColumnLimit: 0
lets the programmer decide where to make line breaks, right? This seems more practical. Clang-format can help with other things.
#define AE_BARRIER \ | ||
4 /* With WRITABLE, never fire the event if the \ | ||
READABLE event already fired in the same event \ | ||
loop iteration. Useful when you want to persist \ | ||
things to disk before sending replies, and want \ | ||
to do that in a group fashion. */ |
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.
Would it reject it if we would do like this?
#define AE_BARRIER \ | |
4 /* With WRITABLE, never fire the event if the \ | |
READABLE event already fired in the same event \ | |
loop iteration. Useful when you want to persist \ | |
things to disk before sending replies, and want \ | |
to do that in a group fashion. */ | |
#define AE_BARRIER 4 /* With WRITABLE, never fire the event if the \ | |
READABLE event already fired in the same event \ | |
loop iteration. Useful when you want to persist \ | |
things to disk before sending replies, and want \ | |
to do that in a group fashion. */ |
I was most likely like this originally before clang-format changed it to the worse...
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.
Oops, that's my mistake, I've overlooked it. It will not reject it, I'll fix it :)
Yeah, good point. I forgot to pin the Basically I would suggest pinning the |
Signed-off-by: Mikhail Koviazin <mikhail.koviazin@aiven.io>
This commit hopefully improves the formatting of the codebase by setting ColumnLimit to 0 and hence stopping clang-format from trying to put as much stuff in one line as possible.
This change enabled us to remove most of
clang-format off
directives and fixed a bunch of lines that looked like this:Additionally, one pair of
clang-format off
/clang-format on
hadclang-format off
as the second comment and hence didn't enable the formatting for the rest of the file. This commit addresses this issue as well.Please tell me if anything in the changes seem off. If everything is fine, I will add this commit to
.git-blame-ignore-revs
later.