Dave Rodgman
7ff7965561
Update headers
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-03 12:04:52 +00:00
Dave Rodgman
dd7b24c3bf
whitespace fix
...
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-07-27 20:01:04 +01:00
Dave Rodgman
e67ffd6d20
pylint tidy-up
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:50:50 +01:00
Dave Rodgman
73b87e39d6
Make code_style.py -s default to -s=mbedtls-2.28
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:44:52 +01:00
Dave Rodgman
b96dbc6486
Make code_style.py -s more precise
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:44:45 +01:00
Gilles Peskine
7b780491f0
Handle deleted files correctly
...
Don't attempt to run on a file that isn't present now.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-04 15:47:02 +02:00
Gilles Peskine
8ceeba4f22
Add --since option to check files modified since a given commit
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-04 15:47:01 +02:00
Gilles Peskine
0f1053c13b
Clean up subprocess invocation in get_src_files
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-04 15:46:59 +02:00
Pengyu Lv
e95df0bd70
Fix CI failure
...
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
Pengyu Lv
4a37eef78f
Only check files known to git
...
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
Pengyu Lv
bae83d25eb
Improve readability
...
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
Pengyu Lv
44b75a605b
adjust help message
...
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
Pengyu Lv
75e11d3703
print skipped file names to stdout
...
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
Pengyu Lv
a4b9b7700a
code_style.py: Add helpers to print warning and skipped files
...
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
Pengyu Lv
b1c9cc3ae4
code_style.py: Apply exclusions to the file list
...
This commit rename `--files` options to `--subset` and
it means to check a subset of the files known to git.
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
David Horstmann
04aaa45ee1
Remove unnecessary '\' linebreak characters
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-25 11:39:45 +00:00
David Horstmann
6956cb58ac
Don't wrap stdout and stderr in UTF-8 wrapper
...
This is no longer needed as we only print ASCII text directly
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
5682e80266
Output diff without capturing it
...
Instead of capturing the output of diff and printing it, let diff do its
own outputting and se the return code to decide what to do.
This also means that the conversion of stdout to UTF-8 is not necessary,
as the reason it was needed was for printing diffs of files with UTF-8
characters in them.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
6d02f0cfa0
Add basic output on success
...
Whilst it is true that "silence is golden", no output at all could be
disconcerting and it makes searching in a CI log more difficult.
Add a simple status message that says "Checked N files, style ok".
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
3febe15114
Remove overly verbose output on success
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
64827e4611
Change print to print_err for an error message
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
a27d872228
Document that the script must be run from the root
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
f7b7bf7a5e
Remove provisional notice on code style script
...
Since code style is now enforced, the notice is wrong. Remove it to
avoid confusion.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
Gilles Peskine
1d671c90db
Merge pull request #6835 from gilles-peskine-arm/code-style-files-2.28
...
Backport 2.28: code_style.py: Support restyling only the specified files
2023-01-19 12:26:07 +01:00
Gilles Peskine
b71d28b695
Fix example command
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-17 18:09:39 +00:00
David Horstmann
242df48cab
Fix pylint warnings about comparison to True
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-05 10:04:21 +00:00
David Horstmann
fa69def8e3
Fix incorrect typing of function in code_style.py
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-05 10:03:48 +00:00
David Horstmann
b92d30f987
Check Uncrustify returncode in code_style.py
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-04 18:44:35 +00:00
Gilles Peskine
7528986f97
Documentation improvements
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-23 18:15:50 +01:00
Gilles Peskine
38f514dbc2
Support restyling only the specified files
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-22 16:37:55 +01:00
Gilles Peskine
4ca54d417e
Don't touch the style of generated files
...
Ideally the result of the generator would conform to the code style, but
this would be difficult, especially with respect to the placement of line
breaks in long logical lines. So, to avoid surprises when checking the style
of generated files (which happens in releases and in long-time support
branches), systematically skip generated files.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-19 00:58:25 +01:00
David Horstmann
eead72ec9e
Reindent line continuations for pylint
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
c747fdfe1f
Fixup: Config file name in code style script
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
1f8b4d9c6b
Add spaces around '+'
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
c543870882
Explain that the script is only for the future
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
3a6f9f9921
Use constant for supported Uncrustify version
...
Define and report the supported Uncrustify version (and remove extra
newlines from version output).
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
99a669a50d
Fix typo in code style script
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
448cfec2a5
Use helper function for error printing
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
27b3704eef
Miscellaneous improvements to code style script
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
20d6bfa8e7
Add script to run Uncrustify
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 17:02:35 +00:00