Skip to content

84 clang-tidy findings become reachable in the two AUTOMOC self-including TUs once #624's fix lands #646

Description

@Yaraslaut

What

examples/common/testkit/test_qml_surface.cpp and src/qt/forms/tests/tst_main.cpp self-include their generated .moc. Until #624, the clang-tidy job could not parse either translation unit at all — it died at the include with clang-diagnostic-error — so no clang-tidy check has ever run over either file in CI.

#624's fix generates the mocs, which makes both TUs analysable. clang-tidy-diff only reports on changed lines, so nothing breaks today. But the findings that were invisible are now live: the first PR that touches one of these lines will fail the clang-tidy job on a finding that has been sitting there the whole time, and will look like the PR's fault.

Verification status

Reproduced. Measured on the #624 branch (4b34bfd5), with this job's own configure, the mocs generated, clang-tidy 22.1.8, running the full file rather than a diff — so this is the whole-file count, not what any one PR would hit:

=== src/qt/forms/tests/tst_main.cpp  (clang-tidy exit=1)
    findings in this file: 3
      1 [readability-redundant-access-specifiers]
      1 [readability-convert-member-functions-to-static]
      1 [misc-use-internal-linkage]
=== examples/common/testkit/test_qml_surface.cpp  (clang-tidy exit=1)
    findings in this file: 81
     73 [misc-const-correctness]
      3 [readability-convert-member-functions-to-static]
      2 [readability-inconsistent-declaration-parameter-name]
      2 [readability-identifier-length]
      1 [bugprone-easily-swappable-parameters]

A sample, verbatim:

src/qt/forms/tests/tst_main.cpp:35:7: error: class 'MorphFormsQmlTestSetup' can be moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage,-warnings-as-errors]
src/qt/forms/tests/tst_main.cpp:41:1: error: redundant access specifier has the same accessibility as the previous access specifier [readability-redundant-access-specifiers,-warnings-as-errors]

examples/common/testkit/.clang-tidy is already in force for the 81-finding file, and tests/.clang-tidy does not apply to either path (src/qt/forms/tests/ and examples/common/testkit/ are outside tests/), which is also why #638's 134-TU sweep never saw them.

Not verified: whether any of the 84 are real defects rather than style. The 73 misc-const-correctness hits are very likely mechanical. Nothing here was measured on a hosted runner.

Why this is filed rather than fixed in #624's PR

examples/common/testkit/test_qml_surface.cpp is held by a concurrent lane, and 81 mechanical edits to a test-surface file are a different change from a CI step. Folding them in would also have hidden the interesting part: the count is the measure of how long the gate was blind.

What would change the verdict

Close this when both files are clean under their own .clang-tidy, or when the specific checks are argued as inapplicable in the nearest .clang-tidy with the reason written down — per #632/#638, a suppression whose reach is not recorded is the bug, not the fix. Re-open if the count grows, which would mean the files are accumulating findings faster than the gate can now report them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VptDWG2fKr2vBnLSJcgzgW

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions