Conversation
ubuntu-26.04's clang-tidy enables checks the 24.04 build never ran. Fix the sites instead of disabling them: - modernize-use-scoped-lock: std::lock_guard<std::mutex> -> std::scoped_lock - modernize-use-designated-initializers - modernize-use-ranges, -use-starts-ends-with - readability-container-contains, -math-missing-parentheses, -use-concise-preprocessor-directives - Headers::Remove uses std::erase_if - beast_transport: const& shared_ptr param; deref ssl once after the has_value() check (bugprone-unchecked-optional-access) runtime/src/http/.clang-tidy additionally excludes clang-analyzer-optin.cplusplus.VirtualCall, a false positive inside Boost.Asio's resolver_thread_pool reached only from beast_transport.cc. metrics.cc aliases the pointer-to-member type so clang-format 18 and 21+ agree on the lambda signature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #237, which kept
linton ubuntu-24.04. The clang-tidy on 26.04 runs checks the old one didn't, and they flagged about 180 sites. This PR fixes those sites instead of turning the checks off, then moveslintto 26.04.modernize-use-scoped-lock:std::lock_guard<std::mutex>→std::scoped_lock, which covers most of the diffmodernize-use-designated-initializers,-use-ranges,-use-starts-ends-withreadability-container-contains,-math-missing-parentheses,-use-concise-preprocessor-directivesHeaders::Remove→std::erase_if. The auto-fix producederase(ranges::remove_if(...), end()), which doesn't compile, so this one was done by hand.beast_transport.cc:WriteWiretakesconst std::shared_ptr&; the lambda already copied it.has_value()check (bugprone-unchecked-optional-access).message::contains, which Boost 1.90 has.runtime/src/http/.clang-tidyalso excludesclang-analyzer-optin.cplusplus.VirtualCall. It's a false positive inside Boost.Asio'sresolver_thread_pooldestructor, reached only frombeast_transport.cc, and it sits next to the existing BoostNewDeleteexclusion.metrics.ccaliases the pointer-to-member type so clang-format 18 and 21+ format that line the same way.Not changed: clang-tidy 22 adds
bugprone-exception-escapeand-unchecked-string-to-number-conversionhits, mostlyatoiin the examplemain()functions. The 26.04 runner's clang-tidy doesn't report them, so they're out of scope here.Testing
beast_transport.cc:158locally. This machine has Boost 1.83 withoutfields::contains; the CI runner's Boost and Bazel's Boost 1.90 have it.--dry-run --Werror: cleanbazel test //... --config=ci: 130/130 pass with both clang and gcc, under-Werrorlinton ubuntu-26.04Checklist
Headers::Remove)bazel test //...passes locally