-
Notifications
You must be signed in to change notification settings - Fork 99
Uncrustify: Update and include new config options #522
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
base: master
Are you sure you want to change the base?
Conversation
Removes the ugly symbol in github.
Line up \ at the end of multi line macros
allow 1 or 2 blank lines between functions
This matches what rustfmt does.
@bradjc I tacked on an update to the uncrustify dependency in |
This breaks one of the leons@iron ~/p/t/l/e/t/u/led-menu (uncrustify-config-2025-06)> git diff master -- main.c
diff --git a/examples/tests/u8g2-demos/led-menu/main.c b/examples/tests/u8g2-demos/led-menu/main.c
index 1a498719..ccd3f1c3 100644
--- a/examples/tests/u8g2-demos/led-menu/main.c
+++ b/examples/tests/u8g2-demos/led-menu/main.c
@@ -6,11 +6,10 @@
#include <libtock/interface/led.h>
// These have to be included before mui.h
-#include <u8g2-tock.h>
-#include <u8g2.h>
-
#include <mui.h>
#include <mui_u8g2.h>
+#include <u8g2-tock.h>
+#include <u8g2.h>
u8g2_t u8g2;
mui_t ui;
From the
I do think it's potentially dangerous, albeit nice if it works. Can we disable it on a case-by-case basis, e.g., through comments? |
Ugh. Sorting includes shouldn't matter. But given that external libraries are of varying quality, I think we should probably disable include sorting. Although I think it would still be reasonable to sort them all once, leave the ones that compile fine alone, fix the ones that don't compile, and then disable the uncrustify option again. So they would be mostly sorted now, just not maintained. |
I actually submitted a patch to fix that: olikraus/u8g2@f36cc20 |
Personally I think the upside is high, compared to |
... I had been thinking about creating a We can merge this after (at the end of?) the tutorial Friday? |
Unfortunately fixing the ordering requirement for u8g2 is going to be a bit of thing. Apologies in advance. PR coming. Sidenote, if cmake actually can do everything for us...that would be amazing. But, getting this all to "just works" is far from trivial. |
Ah, thought that merged upstream PR meant it was a non-issue already — guessing some other updates to the library are bringing unhappiness when bumping that submodule? |
@ppannuto I do agree with you on that, and I think this example is sufficient to sway me to say I'd rather not see include sorting be mandatory. At the very least, we should ensure that any stdlib includes come before other library includes (which, I guess, would mean exhaustively listing out stdlib header files in the |
I guess it's a tradeoff between allowing very carefully addressed cases and bringing everything up to a general standard. I prefer to have the floor. For example I think having this consistency makes more of a difference: ![]() |
This is another round of trying to use uncrustify to make our code consistent and preferably similar in structure to what rustfmt does. Some features are new so this updates uncrustify. That caused some changes as uncrustify fixed some bugs.
Each option/change is its own commit.
New changes:
#include
s. This works pretty well!