-
Notifications
You must be signed in to change notification settings - Fork 50
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
update clang-format #6440
base: master
Are you sure you want to change the base?
update clang-format #6440
Conversation
Problem: .clang-format is out of sync with project style. This uses some newer options (clang 11) to get it a little closer. Originally proposed in flux-framework#4694
Problem: the column limit of 88 chars is inconsistent with current project practices. Set the limit to 80 chars.
Problem: a comment about requiring clang-3.6 or clang-7 is probably no longer useful at this point as those releases are now old. Drop comment.
Problem: the current clang-format removes alignment of the values of consecutive macro assignments, which makes things less readable. clang-20 adds AlignConsecutiveMacros. Add it so we'll be ready.
87f921c
to
f5484bb
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6440 +/- ##
=======================================
Coverage 83.64% 83.65%
=======================================
Files 524 524
Lines 87693 87693
=======================================
+ Hits 73355 73358 +3
+ Misses 14338 14335 -3 |
I see you decided to re-restrict the line length to 80. While we do generally try to hit 80 we don't actually follow it everywhere but clang-format will enforce it. Running a little script to get line lengths of every C source file in src/, filtering out libev and some of the other external things we vendor. There are 466 lines that are between 80 and 88 lines long, and 540 more that are above 88 characters long. A lot of the longer ones (especially over 100 chars) are in the tests, so that mostly doesn't count, but here are the files impacted by at least one line between 80 and 88 characters:
FWIW, the linux kernel also requests a line length of 80 characters, but changed checkpatch and other tooling to only force format or error at 100 characters. That combined with our black line limit being set to 88 was why I had it as 88 to begin with. To be honest I don't really mind, but this is where that came from. |
From RFC 7:
Which implies a best effort, but We could argue that 88 should be the number in RFC 7 but that would be a PR on the RFC. Here we should follow the rule. |
Salvage the improvements to our
.clang-format
file from #4694 which was out of date.