Skip to content

Modernization Phase 1.5: lint remainder — clangd-tidy from PyPI, suppressions triaged to zero - #26

Merged
ptesavol merged 1 commit into
mainfrom
modernize/1.5-lint
Jul 3, 2026
Merged

ptesavol merged 1 commit into
mainfrom
modernize/1.5-lint

Conversation

@ptesavol

@ptesavol ptesavol commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Phase 1.5 closes the lint workstream. Two deliverables:

1. clangd-tidy: git submodule → pinned PyPI install

The submodule pinned tag 0.2.1 (the single-script era). Upstream 1.x is a proper Python package with dependencies (attrs/cattrs/typing-extensions), so a bare checkout is no longer runnable at all — "bump the submodule" was not an option.

  • Submodule deleted; install-prerequisities.sh now does pipx install --force clangd-tidy==1.1.1 on both platforms (pipx: preinstalled on GitHub runners, brew/apt otherwise; ~/.local/bin added to PATH).
  • The 10 lint.sh call sites invoke clangd-tidy from PATH; the unused clang-tidy symlink alias is gone.
  • Gained since 0.2.1: --line-filter clang-tidy parity, diagnostic-formatter fixes, clangd-tidy-diff.

2. .clang-tidy suppression triage: zero suppressions kept

All 11 post-18 check suppressions parked in Phase 1.2 are removed — every finding fixed in code rather than suppressed. 85 findings total (77 from the sweep, 7 more exposed by also dropping the nested test configs' copy, 1 introduced by the ranges conversion itself and fixed):

Check n Fix
readability-container-contains 28 find() != end() → contains(); two substring cases became C++23 std::string::contains
modernize-use-designated-initializers 29 aggregates name their fields
modernize-use-ranges 9 std::ranges:: algorithms (+1 explicit ptrdiff_t cast: ranges::sample takes a signed count)
readability-avoid-return-with-void-value 6 return voidFn(); in void lambdas → plain call
bugprone-suspicious-stringview-data-usage 4 env-var name constants were string_views passed to getenv(.data()) — now const char* (the honest type for a null-terminated-string API)
readability-redundant-casting 3 static_cast<const DhtCallContext&> of a const DhtCallContext& deleted
bugprone-unused-local-non-trivial-variable 3 dead debugString debug leftovers deleted
performance-enum-size 2 ConnectionManagerState, Offerer → : std::uint8_t
bugprone-optional-value-conversion 1 optional→value→optional round-trip → direct optional assignment
readability-use-std-min-max 1 clamp-if → std::min
modernize-use-starts-ends-with 1 (+1 in triage) find() == 0 → starts_with

Several of these touch runtime code paths (ConnectionManager, WebsocketServer, logger internals), hence the full-suite gate below.

Verification

  • Full rebuild + ./lint.sh green across all 8 packages — all checks enabled, clangd-tidy 1.1.1 from pipx
  • 307/307 tests passed
  • clang-format at fixed point; formatting included in the same commit since nearly every formatted hunk is a fixed finding

Remaining in Part 1

Only Phase 1.6 (CI/docs closeout — small). Then Part 2: the modules migration.

🤖 Generated with Claude Code

…ions triaged to zero

- clangd-tidy: git submodule (tag 0.2.1) -> pipx install clangd-tidy==1.1.1.
  Upstream 1.x is a Python package with dependencies; a bare checkout is no
  longer runnable. Unused clang-tidy symlink alias removed.
- .clang-tidy: all 11 post-18 check suppressions parked in Phase 1.2 are
  removed; the 85 findings they hid (incl. 7 more exposed by dropping the
  nested test configs' designated-initializers suppression) are fixed in
  code: contains() (28), designated initializers (29), ranges algorithms
  (9), void-return returns (6), getenv on string_view.data() -> const
  char* constants (4), redundant self-casts (3), dead debugString locals
  (3), uint8_t enum bases (2), optional round-trip (1), std::min (1),
  starts_with (2).
- Verified: full build, lint green all 8 packages, 307/307 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant