-
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: change en/disable markers #10865
uncrustify: change en/disable markers #10865
Conversation
+1 to the change to uncrustify markers |
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.
I'm aware this is very much a question of taste, but
-
why keep the asterisks?
-
why not a more environment-like thing. It feels unintuitive to me that to enter a certain region of code you say "off" and to leave it you say "on". I'd rather expect something like
/* begin{code-style-ignore} */ some* dirty=code; /* end{code-style-ignore} */
(totally inspired by Latex ;P).
Yeah, that captures my feelings, too. Are we fine with having a begin but no end, e.g., when disabling uncrustify for the whole file? |
If SGML is allowed to do that then we are as well... ;-P. |
One word on portability: My current workplace setup (Ubuntu 16.04) isn't able to read the
But that is already the case in master so I don't mind, but Ubuntu 16.04 is still officially supported so our users might still use it so we should pay attention to not lose support for it. I also tested on a somewhat current Debian (docker image |
@jia200x what do you think about the new marker style? |
Much better now :) |
Shit, 0.59 is seven years old. It was superceded by two new releases at the end of 2014. I hope we can just let user's know they'll need to upgrade... Isn't the latest Ubuntu LTS our "officially supported platform"? |
I'm fine with it ;) |
In general, you shouldn't expect users to require their OS to update everytime the newest version pops up just because it is inconvenient to you. Even for stable or LTS. There are valid reasons not to (e.g. no administrative rights on their machine or because people choose a stable OS because they don't want to update that often). There should always be a grace period and IMHO that should be until the official EOL of that OS release. For 16.04 that is 2021. However, in specific I don't mind this minor inconvenience for our code beautifier... |
b2df670
to
674128e
Compare
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.
Ran it on an Arch machine again. Works like a charm. As a general rule we should however add reasonings to these blocks as you did in #10867.
@@ -96,7 +96,7 @@ void board_init_clock(void) | |||
/* Note: The range is limited to ~100MHz and depends on PLL settings */ | |||
PRCI_set_hfrosctrim_for_f_cpu(CPU_DESIRED_FREQ, PRCI_FREQ_UNDERSHOOT); | |||
|
|||
/* disable uncrustify *INDENT-OFF* */ | |||
/* begin{code-style-ignore} */ |
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.
Uncrustify moves this comment one space to the left. Why not fix it ;-)? (the code below probably needs to be moved as well though :-/)
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.
Why not fix it ;-)?
unrelated! ;)
Contribution description
Default uncrustify uses
*INDENT-OFF*
as marker for disabling all formatting processing.As a lot more than indenting is disabled, I find that misleading. Also it kinda screams at me using all-caps.
boards/hifive1/board.c
is currently the only non-vendor file in the repository that made use of the markers. Previously, it used a speaking comment à la/* disable uncrustify *INDENT-OFF* */
.I'd like to change the marker to speak for itself, but allows changing of the used tool.
This PR changes uncrustify's markers to
*auto-format-off*
andauto-format-on
.What do you think?
Testing procedure
See uncrustify output for
boards/hifive1/board.c
with / without PR.Issues/PRs references
none