-
Notifications
You must be signed in to change notification settings - Fork 447
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
Linter usability improvements. #3709
Conversation
74436ca
to
9087ce2
Compare
d1f326e
to
10225b9
Compare
10225b9
to
772a048
Compare
@mbudiu-vmw Making the linters part of CI is a little tricky because you have to run CMake. CMake requires a series of dependencies that need to be installed first. So the CI linter check will not be as light-weight anymore. |
f552b08
to
f00e85f
Compare
f00e85f
to
5e3800a
Compare
I think we also have to strictly say which version of clang-format CI uses, and everyone has to do the formatting with the same version, as one version can break the formatting done by another version. |
I do prefer always running the latest clang-format on CI because upgrading with pip3 is easy and the project moves fairly quickly. However, we can also fix it at the current version, which is |
set(CLANG_FORMAT_CMD clang-format) | ||
add_custom_target( | ||
clang-format | ||
COMMAND ${CLANG_FORMAT_CMD} --Werror --dry-run -i ${CLANG_FORMAT_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.
my version of clang-format does not understand these flags
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 would install the latest version (15.0.4) with pip
and not with apt
. I do not quite know how to bridge this otherwise.
tools/*.h | ||
) | ||
# Filter some folders from the CI checks. | ||
list(FILTER P4C_LINT_LIST EXCLUDE REGEX "backends/p4tools/submodules") |
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.
Is this how extensions should declare exclusions too?
Maybe you can add a comment if that's correct.
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 done specifically for the compiler files. Extensions are free to add files how they see fit.
7e4490c
to
4b5bfb1
Compare
4b5bfb1
to
c9856c2
Compare
Fixes #3704 and fixes #3705. If this is merged in, the run-clang-format and run-cpplint scripts should be obsolete.