-
Notifications
You must be signed in to change notification settings - Fork 2k
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
uncrustify: split lines at 80 chars #10873
Conversation
Needs rebase. |
Here is what I dread: If you want to make
from our coding conventions. I |
+1 I just tried it with code_width=80 and looks fine :) |
Wrapping in the begin/end markers for function declarations? Nah that looks weird. ;)
Hm, I'm not so sure. The coding conventions say "desirable" for a reason, it doesn't make sense to force it. With uncrustify's current config, it would try hard to keep e.g., "int foobar" together. If set to 80 and "foobar" crosses that, uncrustify would wrap before the "int". IMO it looks better to have foobar cross over the 80 chars in those cases. But "desirable" (compared to "forced") is not being argued here, right? Setting uncrustify to 100 max line length would do what the coding conventions currently express: allow some lines to be somewhat longer in order to prevent ugly wraps, at the discretion of the author. (Also, don't let uncrustify create overlength lines itself, as happened here.) I'd like to arrive at an uncrustify config that becomes "fire and forget". If it constantly shortens my declarations because of a couple of chars over 80, I personally find it too intrusive. May I suggest staying with 100 chars (as in, lines really shouldn't be longer), and let the extra characters be leeway as per coding conventions? |
Do you know if Uncrustify enforces ALL lines to be lower than 100 in this case? If so, I'm OK with the proposal ;) |
See, this is where I see the problem. If we argue that |
Or alternatively we get the style discussions you dread, because a maintainer wants a line to be <80, but uncrustify gave you a longer line ;-). |
Ok, in the name of not having to discuss this, this now sets 80 chars line limit. |
e61ff2d
to
f26425f
Compare
@miri64 wanna take another look? |
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.
ACK. Though this might yield some false positives in the CI if we use uncrustify
there, but I think we could have this solved by using different tools there.
Contribution description
Currently, uncrustify doesn't care about too long lines. Unfortunately it also creates them itself, see this.
This PR configures uncrustify to allow a maximum of 100 chars per line.
Testing procedure
Check uncrustify output with and without this change.
Issues/PRs references
#10867