Commit graph

25 commits

Author SHA1 Message Date
David Horstmann
04bdbe3ee0 Remove unnecessary '\' linebreak characters
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-25 11:39:04 +00:00
David Horstmann
6b3ce309ad 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:40:34 +00:00
David Horstmann
ce42cc24d1 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:19:42 +00:00
David Horstmann
089d0d08a0 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 16:56:18 +00:00
David Horstmann
c9f90aaf5a Remove overly verbose output on success
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 16:00:01 +00:00
David Horstmann
28d2157002 Change print to print_err for an error message
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 15:53:36 +00:00
David Horstmann
8b5a449c82 Document that the script must be run from the root
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 15:53:36 +00:00
David Horstmann
995a7c0de0 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 15:53:36 +00:00
Gilles Peskine
52a7aeebf3
Merge pull request #6834 from gilles-peskine-arm/code-style-files
code_style.py: Support restyling only the specified files
2023-01-19 12:26:01 +01:00
Gilles Peskine
d449cedd3a Fix example command
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-12 15:45:32 +01:00
David Horstmann
78d566b216 Fix pylint warnings about comparison to True
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-05 10:02:09 +00:00
David Horstmann
8d1d6edb0b Fix incorrect typing of function in code_style.py
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-05 09:59:35 +00:00
David Horstmann
c571c5b1f0 Check Uncrustify returncode in code_style.py
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-04 18:44:00 +00:00
Gilles Peskine
9d34cf3f0b Documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-23 18:15:19 +01:00
Gilles Peskine
59803dba2b Support restyling only the specified files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-22 16:36:53 +01:00
Gilles Peskine
9a3771e1b3 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:52:39 +01:00
David Horstmann
c6b604e842 Reindent line continuations for pylint
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:38:27 +00:00
David Horstmann
ae93a3f984 Fixup: Config file name in code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:03:01 +00:00
David Horstmann
0ebc12ea41 Add spaces around '+'
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 15:05:53 +00:00
David Horstmann
190041d2b1 Explain that the script is only for the future
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 15:05:53 +00:00
David Horstmann
2cf779ceff 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 15:05:53 +00:00
David Horstmann
9711f4eeb4 Fix typo in code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 15:05:53 +00:00
David Horstmann
ca13c4f59f Use helper function for error printing
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 15:05:53 +00:00
David Horstmann
b7dab41315 Miscellaneous improvements to code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 15:05:53 +00:00
David Horstmann
fa928f1c44 Add script to run Uncrustify
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 15:04:37 +00:00