Skip to content
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

Lint: support running individual rust linters and improve subtree exclusion #29965

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

davidgumberg
Copy link
Contributor

@davidgumberg davidgumberg commented Apr 25, 2024

This PR improves subtree exclusion by rewriting lint checks to reuse common exclusion logic. Most lint checks previously did not exclude crypto/ctaes, the locale linter did not exclude src/crc32

Makes the include guards lint check print all missing include guards before exiting.

Adds support for running individual linters by passing --lint=LINT_CHECK_TO_RUN to the lint runner. If using cargo run arguments can be passed e.g.:

cd test/lint/test_runner && cargo run -- --lint=doc --lint=includes

Supercedes #29744

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 25, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #30034 (ci: add markdown link check job by willcl-ark)
  • #30025 (doc: fix broken relative md links by willcl-ark)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko
Copy link
Member

maflcko commented Apr 26, 2024

The Win64 GHA test failure looks unrelated. If you want, you can split up 54b2115 into its own pull request, as it is an independent improvement. But up to you.

@davidgumberg
Copy link
Contributor Author

I think I will leave it in here since the motivation for 54b2115 is mostly the increased number of lint checks only accessible through the lint test runner. But I will split it out if anyone has an objection, or if this PR stalls.

Add support for passing `--lint=LINT_TO_RUN` to the lint runner and
add corresponding help message.
This makes all the lint checks written in rust exclude subtrees, and
refactors the exclusion lists into a separate file.
Make the include guard linter print all warnings before exiting, and
reuse common exclusion logic to improve subtree exclusion (crypto/ctaes
was previously not excluded)
Rewrites the 'includes' linter to make use of common exclusion logic,
improving subtree exclusion. (crypto/ctaes was previously not excluded)
This commit rewrites the spelling linter to reuse common
exclusion logic and improves subtree exclusion. ('crypto/ctaes' was
previously not excluded)
This commit rewrites the locale linter to reuse common
exclusion logic and improves subtree exclusion (src/crc32c was
previously not excluded)
Rewrites the python encoding lint check to make use of
common exclusion logic.
@davidgumberg
Copy link
Contributor Author

davidgumberg commented Apr 28, 2024

Windows CI appears to have timed out, rebased to get a fresh CI run.

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants