-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
tools: Ensure codeformat.py uses uncrustify 0.72. #15221
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?
tools: Ensure codeformat.py uses uncrustify 0.72. #15221
Conversation
.gitignore: Ignore tools/uncrustify build directory. tools/ci.sh: Replace uncrustify install with from-source build. tools/codeformat.py: Use tools/uncrustify/uncrustify. Signed-off-by: Phil Howard <phil@gadgetoid.com>
Note: It may be prudent to try the "apt install uncrustify" step first and only install from source if there's a version mismatch. This would avoid any performance impact both on CI and to developers who already have the correct version. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #15221 +/- ##
=======================================
Coverage 98.42% 98.42%
=======================================
Files 161 161
Lines 21204 21204
=======================================
Hits 20870 20870
Misses 334 334 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code size report:
|
@dlech just built a pypi package that installs the proper version: |
FYI, I recently published https://pypi.org/project/micropython-uncrustify/ to have an easy way to get a pre-compiled binary with the correct version of uncrustify. This would be more efficient than everyone having to compile it themselves. |
Haha, now that's an approach. D'oh! Downside is that you probably now have to contend with cursed virtualenvs somehow 🫠 ... but that's not my problem runs away Happy to close this and defer to whatever solution you're cookin' up! I got a little carried away 😆 |
Hmmm, well it works -
And bonus points for Windows builds! I guess it's supposed to huck it into /bin if I do naughty things with system python? |
You can also run it like this if you don't want to make a vritualenv or pollute your PATH.
|
Though, uh, remind me not to try and |
Oh nice work, @dlech! I mentioned in the linked issue that I did some work getting uncrustify to build under wasm, but it's even better if you've got it building native binaries for all of the relevant architectures.
|
As identified in #14046 it's really easy to install a mismatched version of Uncrustify and format source in a way that the CI (which just installs whatever mystery meat Uncrustify apt cares to offer) disagrees with.
Eg: when I develop on macOS, brew installs Uncrustify-0.79.0_f.
This may also vary across Linux distributions, and is also prone to some future break if
runs-on: ubuntu-22.04
is ever changed.This change is a proposal for installing Uncrustify in a consistent fashion, so that developers and CI get the same version, the same rules and the same output.