Skip to content

build(clang-tidy): fix silently disabled checks and resulting findings - #1334

Merged
castler merged 6 commits into
eclipse-score:mainfrom
castler:fix_tidy_swallowed_checks
Oct 8, 2026
Merged

castler merged 6 commits into
eclipse-score:mainfrom
castler:fix_tidy_swallowed_checks

Conversation

@castler

@castler castler commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

The Checks value in .clang-tidy is a folded > scalar, so # lines are not comments: they get joined with the next line into one glob that matches nothing. That silently disabled 8 listed checks (verified with clang-tidy --list-checks before/after):

bugprone-use-after-move, bugprone-forwarding-reference-overload, cert-err52-cpp, bugprone-reserved-identifier, bugprone-assert-side-effect, misc-confusable-identifiers, modernize-unary-static-assert, modernize-use-nullptr.

Commit 1 (config): remove comments from the Checks block (documented above it), list the intentionally disabled checks explicitly with -, and drop the *_PRD* macros from bugprone-assert-side-effect.AssertMacros (production-level asserts are always evaluated, so those were false positives).

Then one commit per newly visible finding (7):

  • modernize-unary-static-assert: pointer_arithmetic_util.cpp
  • bugprone-use-after-move (3): GenericProxy move operations now cast to ProxyBase&& so only the base subobject is moved
  • bugprone-assert-side-effect (2): side-effecting calls moved out of the assert/precondition condition (subscription_subscribed_states.cpp, transaction_log_local_view.cpp)
  • bugprone-reserved-identifier: justified NOLINT for GoogleMock's ::testing::_

Verified: --config=ci build of //score/mw/com/impl/... and //score/memory/shared/..., 68/68 local tests pass, clang-tidy aspect shows none of the 8 re-enabled checks firing.

@castler castler changed the title build(clang-tidy): stop comments in Checks from silently disabling checks build(clang-tidy): fix silently disabled checks and resulting findings Oct 7, 2026
@castler
castler marked this pull request as ready for review October 7, 2026 16:02
@castler
castler enabled auto-merge October 7, 2026 16:02
@castler
castler marked this pull request as draft October 8, 2026 06:38
auto-merge was automatically disabled October 8, 2026 06:38

Pull request was converted to draft

@castler
castler force-pushed the fix_tidy_swallowed_checks branch from d59b3a9 to 4a57d23 Compare October 8, 2026 09:31
@castler
castler marked this pull request as ready for review October 8, 2026 09:33
@castler
castler enabled auto-merge October 8, 2026 09:33
@castler
castler added this pull request to the merge queue Oct 8, 2026
castler and others added 6 commits October 8, 2026 12:29
…ecks

The Checks value is a folded YAML scalar, so a '#' line is not a comment:
it is joined with the following line and the result is one glob that
matches nothing. This silently disabled the first check after each
section marker and after the '#modernize-...' lines:

  bugprone-use-after-move, bugprone-forwarding-reference-overload,
  cert-err52-cpp, bugprone-reserved-identifier,
  bugprone-assert-side-effect, misc-confusable-identifiers,
  modernize-unary-static-assert, modernize-use-nullptr

Remove the comment lines from the block (documented above it instead) and
list the intentionally disabled checks explicitly with a leading '-'.

Also drop the *_PRD* macros from bugprone-assert-side-effect.AssertMacros:
production-level asserts are always evaluated, so reporting their side
effects as 'discarded in release builds' is a false positive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes modernize-unary-static-assert.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…erations

Cast 'other' to ProxyBase& and move that, so that only the base class
subobject is moved. The derived members of 'other' are moved afterwards,
which bugprone-use-after-move reported as use after move.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ount

Fixes bugprone-assert-side-effect: evaluate value() once before the
assert instead of inside the (possibly compiled out) condition.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes bugprone-assert-side-effect: call
DoesLogContainIncrementOrDecrementTransactions before the precondition
instead of inside its (possibly compiled out) condition.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes bugprone-reserved-identifier: ::testing::_ is the GoogleMock
wildcard matcher, its name cannot be changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged via the queue into eclipse-score:main with commit e5243da Oct 8, 2026
18 checks passed
@castler
castler deleted the fix_tidy_swallowed_checks branch October 8, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants