Lint: improve subtree exclusion #29965

pull davidgumberg wants to merge 6 commits into bitcoin:master from davidgumberg:rustlinv2 changing 9 files +768 −711
  1. davidgumberg commented at 11:37 pm on April 25, 2024: contributor

    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.

    Supercedes https://github.com/bitcoin/bitcoin/pull/29744

  2. DrahtBot commented at 11:37 pm on April 25, 2024: contributor

    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:

    • #30595 (kernel: Introduce initial C header API by TheCharlatan)
    • #30553 (lint: Find function calls in default arguments by maflcko)
    • #30462 (utils: replace boost::date_time usage with c++20 std::chrono by theuni)
    • #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 Apr 25, 2024
  4. maflcko commented at 6:42 am on April 26, 2024: member
    The Win64 GHA test failure looks unrelated. If you want, you can split up 54b2115bb848e1aad8a86aae858de63a851235ce into its own pull request, as it is an independent improvement. But up to you.
  5. davidgumberg commented at 11:44 pm on April 26, 2024: contributor
    I think I will leave it in here since the motivation for https://github.com/bitcoin/bitcoin/commit/54b2115bb848e1aad8a86aae858de63a851235ce 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.
  6. davidgumberg force-pushed on Apr 28, 2024
  7. davidgumberg commented at 5:19 pm on April 28, 2024: contributor
    Windows CI appears to have timed out, rebased to get a fresh CI run.
  8. DrahtBot added the label CI failed on Apr 28, 2024
  9. DrahtBot added the label Needs rebase on May 13, 2024
  10. davidgumberg force-pushed on May 19, 2024
  11. DrahtBot removed the label CI failed on May 19, 2024
  12. DrahtBot removed the label Needs rebase on May 20, 2024
  13. maflcko commented at 2:17 pm on May 20, 2024: member
    Looks like the conflicting #30034 is close(r) to merge, if you want to review it
  14. DrahtBot added the label Needs rebase on May 30, 2024
  15. fanquake commented at 3:34 pm on May 31, 2024: member

    Looks like the conflicting #30034 is close(r) to merge, if you want to review it

    This is now merged. Can you rebase here?

  16. davidgumberg force-pushed on Jun 2, 2024
  17. davidgumberg commented at 2:56 pm on June 2, 2024: contributor
    Rebased to address merge conflict
  18. DrahtBot added the label CI failed on Jun 2, 2024
  19. DrahtBot commented at 4:07 pm on June 2, 2024: contributor

    🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the documentation.

    Possibly this is due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    Leave a comment here, if you need help tracking down a confusing failure.

    Debug: https://github.com/bitcoin/bitcoin/runs/25703180537

  20. davidgumberg force-pushed on Jun 2, 2024
  21. DrahtBot removed the label Needs rebase on Jun 2, 2024
  22. DrahtBot removed the label CI failed on Jun 2, 2024
  23. maflcko commented at 10:14 am on June 3, 2024: member
    Any thoughts on splitting the first commit out into a separate pull? Seems to be a requested feature by three people so far, but I am not sure about bundling it for review with the other changes here.
  24. davidgumberg commented at 4:25 pm on June 3, 2024: contributor

    Any thoughts on splitting the first commit out into a separate pull? Seems to be a requested feature by three people so far, but I am not sure about bundling it for review with the other changes here.

    You are right, split out the first commit into: #30219

  25. achow101 referenced this in commit ff21eb2def on Jun 12, 2024
  26. DrahtBot added the label Needs rebase on Jun 12, 2024
  27. lint: Rust linters exclude subtrees
    This makes all the lint checks written in rust exclude subtrees, and
    refactors the exclusion lists into a separate file.
    9d1423a90a
  28. Reuse subtree exclusion in include guard lint
    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)
    f777a48fdd
  29. Reuse subtree exclusion in includes linter
    Rewrites the 'includes' linter to make use of common exclusion logic,
    improving subtree exclusion. (crypto/ctaes was previously not excluded)
    a85cc73013
  30. Reuse subtree exclusion in spelling linter
    This commit rewrites the spelling linter to reuse common
    exclusion logic and improves subtree exclusion. ('crypto/ctaes' was
    previously not excluded)
    cfb7424dd1
  31. Reuse subtree exclusion in locale linter
    This commit rewrites the locale linter to reuse common
    exclusion logic and improves subtree exclusion (src/crc32c was
    previously not excluded)
    e51d3cbb5c
  32. Reuse subtree exclusion in python encoding linter
    Rewrites the python encoding lint check to make use of
    common exclusion logic.
    625117d3d7
  33. davidgumberg force-pushed on Jun 13, 2024
  34. davidgumberg renamed this:
    Lint: support running individual rust linters and improve subtree exclusion
    Lint: improve subtree exclusion
    on Jun 13, 2024
  35. davidgumberg commented at 5:24 pm on June 13, 2024: contributor
    Rebased over master since #30219 was merged.
  36. DrahtBot removed the label Needs rebase on Jun 13, 2024
  37. DrahtBot added the label CI failed on Jun 18, 2024
  38. DrahtBot removed the label CI failed on Jun 18, 2024
  39. in test/lint/test_runner/src/main.rs:181 in 9d1423a90a outdated
    183-            "./src/",
    184-            ":(exclude)src/util/fs.h",
    185-        ])
    186+        .args(["grep", "std::filesystem", "--"])
    187+        .args(["--", "./src"])
    188+        .args(exclude::get_pathspecs_exclude_std_filesystem())
    


    maflcko commented at 11:22 am on August 9, 2024:

    nit in 9d1423a90a3b9748426deec7bafe8b12113e1baf: Not sure about moving a single string literal that is used in a single function to a new module into a new function.

    args allows for chaining, so if you want to append more args to the existing ones, my recommendation would be to just call args one more time with the args that you want to append.

    I think the lint tests can be easy to understand and pragmatic, and adding too many layers may not be useful to understand them.

    (This will also make the diff smaller, and is thus easier to review)

  40. DrahtBot added the label Needs rebase on Aug 12, 2024
  41. DrahtBot commented at 12:23 pm on August 12, 2024: contributor

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

  42. maflcko commented at 10:10 pm on September 11, 2024: member
    Are you still working on this?
  43. davidgumberg commented at 4:31 pm on September 12, 2024: contributor
    Closing this for now, it’s up for grabs, if I have a chance to work on this again soon I’ll split into smaller PR’s
  44. davidgumberg closed this on Sep 12, 2024


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: 2024-09-28 22:12 UTC

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