Lint: Support running individual lint checks #30219

pull davidgumberg wants to merge 1 commits into bitcoin:master from davidgumberg:individual_lints changing 2 files +138 −15
  1. davidgumberg commented at 4:23 PM on June 3, 2024: contributor

    This PR was split out from #29965:

    Adds support for running individual tests in the rust lint suite by passing --lint=LINT_TO_RUN to the lint runner. This PR also adds a corresponding help message.

    When running with cargo run, arguments after a double dash (--) are passed to the binary instead of the cargo command. For example, in order to run the linter check that tabs are not used as whitespace:

    cd test/lint/test_runner && cargo run -- --lint=tabs_whitespace
    
  2. DrahtBot commented at 4:23 PM on June 3, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, marcofleon, achow101
    Concept ACK kristapsk

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #29965 (Lint: support running individual rust linters and improve subtree exclusion by davidgumberg)
    • #29119 (refactor: Use std::span over Span by maflcko)

    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.

  3. DrahtBot added the label Tests on Jun 3, 2024
  4. in test/lint/README.md:41 in 38e8ff4f9e outdated
      36 | +
      37 | +To see a list of all individual lint checks available in test_runner, use `-h`
      38 | +or `--help`:
      39 | +
      40 | +```sh
      41 | +( cd ./test/lint/test_runner/ && RUST_BACKTRACE=1 cargo run -- --help
    


    maflcko commented at 10:24 AM on June 4, 2024:
    ( cd ./test/lint/test_runner/ && RUST_BACKTRACE=1 cargo run -- --help )
    
  5. maflcko approved
  6. maflcko commented at 10:58 AM on June 4, 2024: member

    lgtm

  7. Support running individual lint checks
    Add support for passing `--lint=LINT_TO_RUN` to the lint runner and
    add corresponding help message.
    0fcbfdb7ad
  8. davidgumberg force-pushed on Jun 4, 2024
  9. maflcko commented at 1:18 PM on June 4, 2024: member

    ACK 0fcbfdb7ad172e518a10dd6e5be4cb6bb1158784

  10. marcofleon approved
  11. marcofleon commented at 3:52 PM on June 12, 2024: contributor

    Tested ACK 0fcbfdb7ad172e518a10dd6e5be4cb6bb1158784. Ran cargo run with various of the individual tests and with bad input. Also ran it with no arguments. Everything works as expected and help message looks good.

  12. kristapsk commented at 4:29 PM on June 12, 2024: contributor

    Concept ACK

  13. achow101 commented at 9:19 PM on June 12, 2024: member

    ACK 0fcbfdb7ad172e518a10dd6e5be4cb6bb1158784

  14. achow101 merged this on Jun 12, 2024
  15. achow101 closed this on Jun 12, 2024

  16. davidgumberg deleted the branch on Jun 12, 2024
  17. bitcoin locked this on Jun 12, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me