Repository navigation
Add a clang-tidy configuration and CI lane - #189
Merged
Merged
Conversation
derobins
requested review from
akolliasAMD,
gaoikawa,
jordan-turbofish,
kurtmcmillan,
riley-dixon,
sbates130272 and
zbyrne
as code owners
October 13, 2026 14:47
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The check configurations use an unsupported YAML shape, preventing clang-tidy from running successfully.
3 open findings
What changed in this PR
Adds strict clang-tidy configuration and a dedicated CI lane.
Changes:
- Enables security, correctness, modernization, and portability checks.
- Adds LLVM 23 clang-tidy CI with finding summaries.
- Adjusts workflow triggers and contributor guidance.
| File | Description |
|---|---|
.clang-tidy |
Defines repository-wide checks and exclusions. |
examples/.clang-tidy |
Disables checks requiring post-C++11 features. |
.github/workflows/hipobject-clang-tidy.yml |
Adds the clang-tidy CI lane. |
.github/workflows/hipobject-build.yml |
Excludes tidy-only changes. |
.github/workflows/hipobject-iwyu.yml |
Excludes tidy-only changes. |
.github/workflows/hipobject-minio-integration-check.yml |
Excludes tidy-only changes. |
AGENTS.md |
Documents clang-tidy usage and CI. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
derobins
force-pushed
the
derobins/clang_tidy
branch
from
October 13, 2026 15:02
a9cd834 to
9bfeae4
Compare
Add .clang-tidy with an aggressive set of checks that leans toward security and modern C++, and a CI workflow that fails on any finding. The configuration enables these groups in full: bugprone, cert, clang-analyzer, concurrency, cppcoreguidelines, misc, modernize, performance, portability, and readability. It also enables android-cloexec-* (file descriptors leaking into child processes) and google-runtime-int (AGENTS.md's rule against long). The hicpp checks it names only exist under those names before LLVM 23. Every finding is an error. ExcludeHeaderFilterRegex means it needs clang-tidy 19 or later. - 81 checks report problems in the current code. Each is turned off on its own line, marked TODO with the number of places it reports, so it can be turned back on once that code is fixed. Checks with an alias or an older name are turned off under every name. - Four style-only checks that contradict the project's conventions or tooling are turned off for good: trailing return types, identifier length, #pragma once, and misc-include-cleaner (IWYU covers includes, and AGENTS.md makes its suggestions advisory). - The public header (C11) and src/common/ibv-core.h (mirrors libibverbs' C ABI, so its enums can't change type) aren't checked. - examples/.clang-tidy turns off the checks whose fixes need C++14 or later, since the examples are written to C++11 but built as C++20. The new hipobject-clang-tidy.yml lane builds the default configuration with HIPOBJ_USE_CLANG_TIDY in the usual ROCm 10.0 image, with amdclang++ as the compiler. As in hipFile's clang-tidy workflow, it installs upstream clang-tidy 23 from apt.llvm.org, because ROCm's clang-tidy is built without the clang-analyzer checks, and 23 matches ROCm 10.0's LLVM. apt only trusts the key with apt.llvm.org's known fingerprint, and only for that repository. The build keeps going after a failure, so one run reports every finding, and a failed run lists the findings per check in the job summary. The Build, IWYU, and MinIO Integration Check workflows no longer run for a change to only the .clang-tidy files. AGENTS.md now describes the configuration and the lane. Co-authored-by: Claude <noreply@anthropic.com>
derobins
force-pushed
the
derobins/clang_tidy
branch
from
October 13, 2026 15:12
9bfeae4 to
cb0ff38
Compare
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.



Add .clang-tidy with an aggressive set of checks that leans toward security and modern C++, and a CI workflow that fails on any finding.
The configuration enables these groups in full: bugprone, cert, clang-analyzer, concurrency, cppcoreguidelines, misc, modernize, performance, portability, and readability. It also enables android-cloexec-* (file descriptors leaking into child processes) and google-runtime-int (AGENTS.md's rule against long). The hicpp checks it names only exist under those names before LLVM 23. Every finding is an error. ExcludeHeaderFilterRegex means it needs clang-tidy 19 or later.
The new hipobject-clang-tidy.yml lane builds the default configuration with HIPOBJ_USE_CLANG_TIDY in the usual ROCm 10.0 image, with amdclang++ as the compiler. As in hipFile's clang-tidy workflow, it installs upstream clang-tidy 23 from apt.llvm.org, because ROCm's clang-tidy is built without the clang-analyzer checks, and 23 matches ROCm 10.0's LLVM. apt only trusts the key with apt.llvm.org's known fingerprint, and only for that repository. The build keeps going after a failure, so one run reports every finding, and a failed run lists the findings per check in the job summary.
The Build, IWYU, and MinIO Integration Check workflows no longer run for a change to only the .clang-tidy files. AGENTS.md now describes the configuration and the lane.