feat(lint): support clang-tidy across platforms - #296
Merged
Conversation
clang-tidy interprets parenthesized check lists as scoped suppressions. Convert all existing NOLINT directives mechanically and update clang-format's CommentPragmas matcher for the new syntax.
Support both system and PyPI wheel runners, configure macOS compile commands with the SDK sysroot, and allow callers to select a clang-tidy binary without installing the wheel. Address LLVM 23.1 diagnostics while retaining a narrow suppression for the unsafe PyObject const suggestion.
Remove suppressions that are no longer needed and retain only diagnostics reproduced by the supported clang-tidy versions. Keep LLVM 22 compatibility aliases where diagnostic names differ.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 1623 1623
Branches 220 220
=========================================
Hits 1623 1623 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
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.
Description
NOLINTsyntax and teach clang-format to preserve it.CLANG_TIDY, support both system and PyPI runner names, and preserve caller-provided CMake configuration arguments.Motivation and Context
The PyPI clang-tidy wheel provides a consistent analyzer across Linux and macOS, but macOS analysis also needs the SDK sysroot in the compilation database. The previous suppressions included entries that no longer corresponded to emitted diagnostics and did not consistently cover renamed LLVM checks.
Types of changes
Implemented Tasks
NOLINTsuppressions individually across supported LLVM versions and platforms.Checklist
make format. (required)make lint. (required)make testpass. (required)Validation
make test: 93,901 passed, 26 skipped, 1 xfailed; 100% coverage.make format: passed without changing the committed tree.pre-commit run --all-files: passed.make lint CMAKE_CXX_STANDARD=17: all code checks passed, including clang-tidy and cpplint, but the target stopped indocstylebecause Sphinx 9.1 reports two unresolvedClassVarforward-reference warnings for the unchangedPyTreeAccessorannotations.