-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Uncrustify warnings #8522
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 warnings #8522
Conversation
We know that using a different version of uncrustify produces different results. So make that an error rather than a warning. Also make the error output more helpful if uncrustify is not found. Signed-off-by: Gilles Peskine <[email protected]>
This makes it easier to run the script on a machine where the system-installed uncrustify is a different version. Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
minosgalanakis
left a comment
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.
Looks good overall, with a minor tibit.
| stderr=subprocess.PIPE) | ||
| return str(output, "utf-8").strip() | ||
| except FileNotFoundError: | ||
| sys.stderr.write('Fatal: command {} not found in PATH.\n' |
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.
This is a very nice practise.
| if args.fix: | ||
| # Fix mode | ||
| return fix_style(src_files) | ||
| return fix_style(args.uncrustify, src_files) |
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.
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_EXE shouldn't exist anymore... But I missed an occurrence. I'll fix that.
Before this commit, verify mode still hard-coded "uncrustify" as the command name. Signed-off-by: Gilles Peskine <[email protected]>
minosgalanakis
left a comment
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.
LGTM
|
Most of the affected code is now in the framework, so I raised a new pull request there: Mbed-TLS/mbedtls-framework#233 The |
Make
scripts/code_style.pyeasier to use by occasional contributors. In particular, insist on the version we require. Currently we have a warning but people ignore warnings.PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")