Repository navigation
fix(tidy): the 31 non-swappable #681 clang-tidy rows — 21 fixed byte-identical, 10 baselined - #734
Conversation
Fixed (output byte-identical):
- performance-inefficient-vector-operation x5: reserve() before the push loops
(pyUnhandledOutcome, switchArmsOf, retargetCfgTouchLines, appendTangleRatchet, compilerOutputs).
- performance-unnecessary-value-param: Script::visit takes reach by const& (each recursion copied it);
dedupeLintFindings moves the kept rows out of the moved-in `outs` instead of copying them.
- bugprone-narrowing-conversions x2: explicit char casts (defGroupsSilent, cppScopeNames |= bit).
- bugprone-exception-escape: AnswerFirstFallback::disclose is noexcept but emitTo's std::print could
throw bad_alloc; the two constant messages now go through emitRaw (same bytes).
- bugprone-implicit-widening-of-multiplication-result: kLargeBytes multiplies in size_t.
- bugprone-inc-dec-in-conditions: the rc-file scan lambda is named before the condition, not
invoked inside it (unreadRcFileSites).
- bugprone-signed-char-misuse: cmakeCallStart compares unsigned char to unsigned char (latent:
every kCMakeCommands name is ASCII today).
- bugprone-suspicious-stringview-data-usage: memstats::mark takes the const char* literal that
notePhase keeps, so the NUL-termination is in the type, not a comment.
- clang-analyzer-optin.performance.Padding: MemberShape widest members first, one-byte fields last.
- performance-for-range-copy: jsPatternNames loop binds const std::string&.
- performance-move-const-arg: pushTypedBind takes const DeclType&; the std::move was a copy.
- performance-no-automatic-move: unjudgedBase's byName is no longer const, so the return moves.
Accepted (baseline rows added):
- bugprone-unchecked-optional-access graph.h `*head_`: every caller of mayRunCandidate checks
head_.has_value() first (runsOnlyStd short-circuits, declineList / pruneTier return early).
- bugprone-unchecked-optional-access shstatus.h `*last`: the round loop emplaces it on round 0.
- bugprone-unchecked-optional-access verbs_for.h `r.out->bytes`: capturedWhole(r.out) checks has_value.
- performance-unnecessary-value-param testmap.h groupRunTail: the house EscapeFn-by-value form
(9 sibling rows already baselined).
- bugprone-incorrect-roundings model.h x2: tangle T / S are never negative; half-up `+ 0.5` is the
documented rounding every surface shares.
- clang-analyzer-deadcode.DeadStores graph.h x2 (one more occurrence each): `disposition` is read by
the DispositionTally RAII guard at each continue.
- bugprone-suspicious-missing-comma legenddict.h: the kCoreEntries first entry is one deliberately
concatenated four-line literal (its old-text row is deleted).
- bugprone-throwing-static-initialization lsp.h gLangMap: only bad_alloc of the four default
overrule suffixes, before main.
Deleted baseline rows the nightly no longer reports (source gone): defectshape faster-string-find,
ingest_valuerefs move-const-arg, legenddict old missing-comma text, testmap exception-escape
groupable, and one `{` branch-clone each in defectshape.h and lsp.h.
The 74 bugprone-easily-swappable-parameters rows are left for their own qd card.
Refs #681
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
tidy: fix or baseline the 31 non-swappable clang-tidy rows of #681
Triage of the nightly advisory clang-tidy NEW rows in #681, except the 74
bugprone-easily-swappable-parametersrows (they belong to a separate quality-delta card). Every one of the 31 rows was still on main at 5a3df04. 21 are fixed and 10 are accepted into.clang-tidy-baseline.txt, each with a one-line reason in the commit message. Six baseline rows that the nightly reports as GONE, whose source text no longer exists, are deleted.reserve()before the push loopshead_;lastis emplaced on round 0;capturedWholechecks the optionalScript::visittakesreachby const& (each recursion copied it);dedupeLintFindingsmoves kept rows;groupRunTailkeeps the house EscapeFn-by-value form (9 sibling rows are already baselined)+ 0.5is the shared roundingcharcastsdispositionis read by theDispositionTallyRAII guardAnswerFirstFallback::disclosecalledemitTo, whosestd::printcould throwbad_alloc; it now callsemitRawwith the same byteskLargeBytesis computed insize_tcmakeCallStartcompares unsigned with unsigned. This was latent only: every command name is ASCIImemstats::marknow takes theconst char*literal thatnotePhasekeepsgLangMapcan only throwbad_allocwhile building four default suffixes, before main runsMemberShapeputs the widest members firstconst std::string&pushTypedBindtakesconst DeclType&, so the move was a copyconst, so the return moves itNone of the fixes is an output bug. Every fix leaves the output byte-identical (evidence below).
Byte-identity evidence
--depsand map md5 on the large-repo corpus: on envoy, cockroach and vscode,--depsand the plain map give 6/6 identical stdout, stderr and rc. The base is the 0.7.0 binary built from e3d766cd6, whosesrc/is identical to main 5a3df04. The lane is 510c82f. Both runs used--no-cache.origin/main..HEAD: gating=0. It reported one minor verbosity row (switchArmsOf64→65, from thereserve()line).No regression arms were added: none of the correctness-candidate rows turned out to be a live output bug.
Refs #681 (non-swappable rows)
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Refactor