-
Notifications
You must be signed in to change notification settings - Fork 12
New ot-tidy.py
script for development and CI
#192
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
Conversation
6f186e8
to
6a440b3
Compare
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.
I get this error from the script:
$ scripts/opentitan/ot_tidy.py --ci-files
Could not parse 'clang-tidy' version string.
Here's my output of clang-tidy --version
:
$ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 16.0.2
Optimized build.
I think it's because my version_line
is the second line, not the first
6a440b3
to
898b946
Compare
Fixed it to look for that on any line.
|
Yep, that works now, thanks |
898b946
to
8cb2bfe
Compare
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.
I think several features are broken, and some are a bit fragile (parsing, ANSI management, ...).
Can you run flake8, as there are many outsized lines and argument aligment warning messages. Thanks.
8cb2bfe
to
700b982
Compare
700b982
to
665fef0
Compare
ot_tidy.py
script for development and CIot-tidy.py
script for development and CI
5b68d97
to
e86476a
Compare
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.
Thanks, I've left a couple of additional comments. This LGTM though and definitely makes local clang-tidy
runs faster.
This script is intendde to replace the `ot-tidy.sh` script for running clang-tidy on our part of the codebase. A `-j` flag is added to run clang-tidy jobs in parallel, using the run-clang-tidy script that comes with it. On my machine this speeds up linting files for CI from >3 minutes to ~30 seconds. The script also checks for some configuration issues, such as the C compiler for QEMU not being set to clang - this causes some warnings flags to be enabled that are recognised by GCC but not clang, and these will show up as errors. Signed-off-by: Alice Ziuziakowska <a.ziuziakowska@lowrisc.org>
Replaces all usages and updates docs. Older `ot-tidy.sh` script is retained for any current users of it. Signed-off-by: Alice Ziuziakowska <a.ziuziakowska@lowrisc.org>
Regression failure is known and unrelated |
This replaces the existing
ot-tidy.sh
script with a new Python script.This new script should make it easier to run the linter locally in the same way as CI, as the older wrapper script did not have any usage information.
The script also checks for some misconfigurations and reports those - such as QEMU not being configured to use Clang which results in a different incompatible set of warning flags to be used with GCC to be used for
clang-tidy
.In addition, this script adds a
-j
flag to run linting in parallel, using therun-clang-tidy
wrapper that comes withclang-tidy
. On my machine, this reduced linting time on the same set of files as CI from ~3 minutes to 30 seconds.