refactor: Enable clang-tidy rule to reject anon namespace in header #35895

pull maflcko wants to merge 3 commits into bitcoin:master from maflcko:2608-tidy-anon-header changing 3 files +9 −12
  1. maflcko commented at 9:24 AM on August 5, 2026: member
  2. refactor: Use C++20 std::identity over IntIdentity fafe5042bd
  3. refactor: Enable clang-tidy rule to reject anon namespace in header
    The rule is named misc-anonymous-namespace-in-header in clang-tidy-22,
    but use fuchsia-header-anon-namespaces for compat with clang-tidy-21.
    fa5ca877b6
  4. DrahtBot renamed this:
    refactor: Enable clang-tidy rule to reject anon namespace in header
    refactor: Enable clang-tidy rule to reject anon namespace in header
    on Aug 5, 2026
  5. DrahtBot added the label Refactoring on Aug 5, 2026
  6. DrahtBot commented at 9:24 AM on August 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35895.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK sedited
    Stale ACK hebasto

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. refactor: Enable misc-definitions-in-headers fa93132d6d
  8. hebasto approved
  9. hebasto commented at 9:57 AM on August 5, 2026: member

    ACK fa5ca877b60339c858b5045f855ae0256e63b69d.

  10. maflcko commented at 10:11 AM on August 5, 2026: member

    Hmm, https://clang.llvm.org/extra/clang-tidy/checks/misc/definitions-in-headers.html has some similar ODR checks, and it is passing, so might as well enable it in a separate commit here.

    <strike>Also, https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/interfaces-global-init.html, which should be the last check we care about to enable for globals.</strike>

  11. DrahtBot added the label CI failed on Aug 5, 2026
  12. maflcko force-pushed on Aug 5, 2026
  13. maflcko removed the label CI failed on Aug 5, 2026
  14. DrahtBot added the label CI failed on Aug 5, 2026
  15. DrahtBot commented at 10:37 AM on August 5, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task tidy: https://github.com/bitcoin/bitcoin/actions/runs/30996402317/job/92274495762</sub> <sub>LLM reason (✨ experimental): Clang-tidy failed due to cppcoreguidelines-interfaces-global-init errors (warnings-as-errors) from CAPNP-generated *.capnp.c++ files initializing non-local globals using uninitialized variables.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly 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.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

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

    </details>

  16. DrahtBot removed the label CI failed on Aug 5, 2026
  17. in src/.clang-tidy:11 in fa93132d6d
       7 | @@ -8,8 +8,10 @@ bugprone-use-after-move,
       8 |  bugprone-lambda-function-name,
       9 |  bugprone-unhandled-self-assignment,
      10 |  bugprone-unused-return-value,
      11 | -misc-unused-using-decls,
      12 | +fuchsia-header-anon-namespaces,
    


    sedited commented at 12:06 PM on August 5, 2026:

    maflcko commented at 12:44 PM on August 5, 2026:

    It is in the commit message, but no strong opinion. Happy to push whatever name the reviewers want.

  18. sedited approved
  19. sedited commented at 12:49 PM on August 5, 2026: contributor

    ACK fa93132d6da508597205513725ba4663d3a24954

  20. DrahtBot requested review from hebasto on Aug 5, 2026
  21. fanquake merged this on Aug 5, 2026
  22. fanquake closed this on Aug 5, 2026

  23. maflcko deleted the branch on Aug 5, 2026

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-08-11 10:50 UTC

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