-
Notifications
You must be signed in to change notification settings - Fork 270
[CI][Lint] Retire format.sh
and add clang-tidy
to GHA workflow
#1044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
WalkthroughReplaces CI format-check with a clang-tidy-driven job (fresh CMake build, discover sources, run run-clang-tidy/clang-tidy with optional auto-fix, print git diff on failure), adds cmake-build to .gitignore, removes legacy format.sh, restructures .clang-tidy, bumps clang tooling versions, and applies many small formatting and const-ref binding tweaks across sources. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions
participant Job as CI Job
participant CMake as CMake (cmake-build)
participant Wrapper as run-clang-tidy / wrapper
participant Tidy as clang-tidy
participant Git as git
Dev->>GH: push / open PR
GH->>Job: start workflow
Job->>Job: prepare env (install LLVM if needed)
Job->>CMake: cmake -S . -B cmake-build --fresh
Job->>Job: discover C/C++ sources under src/
alt run-clang-tidy present
Job->>Wrapper: run-clang-tidy -clang-tidy-binary ... -p cmake-build <files> [--fix]
else download wrapper
Job->>Job: download run-clang-tidy.py
Job->>Wrapper: python run-clang-tidy.py -clang-tidy-binary ... -p cmake-build <files> [--fix]
end
opt clang-tidy failure
Wrapper->>Git: git --no-pager diff --color=always
Job-->>GH: fail with clang-tidy exit code
end
Job->>Job: cleanup cmake-build/ and run-clang-tidy.py
Job-->>GH: finish
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/ci.yml
(1 hunks).gitignore
(1 hunks)format.sh
(0 hunks)
💤 Files with no reviewable changes (1)
- format.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.clang-tidy (1)
10-58
: Checks block includes inline comments; clang-tidy will treat them as unknown check namesLines starting with “# …” are part of the folded string, not YAML comments. clang-tidy will parse them as tokens and likely fail. Remove the comment lines from within the Checks string (keep comments outside the scalar).
Apply this diff:
Checks: >- - # 1. Retained categories: easier to find bugs/performance issues clang-analyzer-*, cppcoreguidelines-pro-type-static-cast-downcast, cppcoreguidelines-pro-type-member-init, cppcoreguidelines-pro-bounds-array-to-pointer-decay, cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-slicing, cppcoreguidelines-narrowing-conversions, performance-*, - - # 2. Readability: only keep useful rules readability-braces-around-statements, readability-container-size-empty, readability-delete-null-pointer, readability-redundant-member-init, readability-redundant-smartptr-get, readability-redundant-string-cstr, - - # 3. Disable all intrusive/style-breaking rules -readability-identifier-length, -readability-avoid-const-params-in-decls, -readability-else-after-return, -cppcoreguidelines-avoid-magic-numbers, -modernize-use-trailing-return-type, -modernize-use-nodiscard, -modernize-use-auto, -modernize-pass-by-value, -modernize-return-braced-init-list, -modernize-use-default-member-init, -modernize-loop-convert, -modernize-concat-nested-namespaces, -llvm-include-order, -bugprone-unused-return-value, -clang-diagnostic-unused-result, -cppcoreguidelines-special-member-functions, -performance-noexcept-move-constructor, -cppcoreguidelines-narrowing-conversions, -clang-diagnostic-error, -cppcoreguidelines-pro-type-member-init, -clang-analyzer-optin.cplusplus.UninitializedObject, -cppcoreguidelines-pro-type-static-cast-downcast, -performance-unnecessary-value-param, -performance-enum-size, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -clang-analyzer-deadcode.DeadStores, -clang-analyzer-optin.cplusplus.VirtualCall, -clang-diagnostic-tautological-constant-compare,
🧹 Nitpick comments (4)
.clang-tidy (4)
49-51
: Conflicting toggles disable key safety checksYou enable these earlier but later disable them; last-match-wins means they end up disabled:
- cppcoreguidelines-pro-type-member-init (Line 49)
- cppcoreguidelines-pro-type-static-cast-downcast (Line 51)
- cppcoreguidelines-narrowing-conversions (Line 47)
Is this intentional? If not, drop the later “-…” entries.
7-7
: HeaderFilterRegex is too broad; may exclude legitimate paths containing “build”Pattern excludes any path with substring “build” (e.g., src/builders/…). Prefer segment-based exclusion and the actual build dir name.
Apply this tweak:
-HeaderFilterRegex: '^(?!.*(3rdparty|build)).*$' +HeaderFilterRegex: '^(?!.*(?:^|/)(?:3rdparty|cmake-build)(?:/|$)).*$'
6-6
: WarningsAsErrors: "*" will fail CI on any warningGood for strictness, but brittle for large diffs and third‑party headers that slip through. Confirm this is intended now that format.sh is retired.
Option: narrow to high-signal checks (e.g., “clang-analyzer-,performance-”) or gate via CI env to allow temporary soft-fail.
3-3
: ExtraArgs: ['-v'] increases CI noiseVerbose compilation output can flood logs. Consider dropping “-v” unless needed for debugging.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.clang-tidy
(1 hunks).github/workflows/ci.yml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yml
9d915d2
to
def09a4
Compare
format.sh
and add clang-tidy
to GHA workflowformat.sh
and add clang-tidy
to GHA workflow
b7fbeb0
to
b4b454d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
320-324
: Restrict clang-tidy inputs to translation units from compile_commands.json (and add parallelism).Current find:
- Includes headers and misses proper grouping, risking false positives and failures.
- Prior review already flagged headers in the list causing clang-tidy errors. Use compile_commands.json instead and parallelize runs.
- CXX_FILES=$(find src -type f -iname "*.[ch]pp" -o -iname "*.cc" -o -iname "*.c" -o -iname "*.h") - rc=0 - "${CLANG_TIDY[@]}" -clang-tidy-binary="$(command -v clang-tidy)" \ - -p="cmake-build" ${CXX_FILES} || rc="$?" + # Extract translation units from compile_commands.json (exclude headers) + mapfile -t CXX_FILES < <(jq -r '.[].file' cmake-build/compile_commands.json | \ + awk '/\.(c|cc|cpp|cxx|cu|m|mm)$/ {print}' | sort -u) + if (( ${#CXX_FILES[@]} == 0 )); then + echo "::warning::No translation units found in compile_commands.json; skipping clang-tidy." + exit 0 + fi + # Determine reasonable parallelism + if command -v nproc >/dev/null; then JOBS="$(nproc)"; else JOBS="$(sysctl -n hw.ncpu 2>/dev/null || echo 2)"; fi + rc=0 + "${CLANG_TIDY[@]}" -j "${JOBS}" -clang-tidy-binary="$(command -v clang-tidy)" \ + -p="cmake-build" "${CXX_FILES[@]}" || rc="$?"If jq may be missing on some self-hosted runners, consider adding a minimal jq install or a small Python fallback. Based on learnings
🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)
229-239
: Guard Homebrew ops and export only if brew exists (Metal runners).On non-GitHub-hosted/mac runners without Homebrew, these commands will fail. Add a guard and quieter install.
- brew update --quiet --force - brew list --formula llvm >/dev/null || brew install --formula llvm - export PATH="$(brew --prefix llvm)/bin:${PATH}" - export CPPFLAGS="-I$(brew --prefix llvm)/include${CPPFLAGS:+ ${CPPFLAGS}}" + if command -v brew >/dev/null; then + brew update --quiet --force + brew list --formula llvm >/dev/null || brew install --quiet --formula llvm + export PATH="$(brew --prefix llvm)/bin:${PATH}" + export CPPFLAGS="-I$(brew --prefix llvm)/include${CPPFLAGS:+ ${CPPFLAGS}}" + else + echo "::warning::Homebrew not found; relying on system LLVM/clang-tidy." + fi
302-315
: Match run-clang-tidy version to clang-tidy and avoid duplicate -fix.
- Hardcoded 20.x may mismatch installed clang-tidy and cause option/diagnostic drift.
- You append -fix twice when run-clang-tidy is present.
- if [[ -x "$(command -v run-clang-tidy)" ]]; then - echo "Using run-clang-tidy from $(command -v run-clang-tidy)" - CLANG_TIDY=(run-clang-tidy -fix) - else - echo "Downloading run-clang-tidy script" - wget -O run-clang-tidy.py https://raw.githubusercontent.com/llvm/llvm-project/refs/heads/release/20.x/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py - CLANG_TIDY=(uv run --no-project --script -- run-clang-tidy.py) - fi - if [[ -x "$(command -v clang-apply-replacements)" ]]; then - echo "Using clang-apply-replacements from $(command -v clang-apply-replacements)" - CLANG_TIDY+=(-fix -clang-apply-replacements-binary="$(command -v clang-apply-replacements)") - else - echo "::warning::clang-apply-replacements not found in PATH, automatic fixing disabled." - fi + if [[ -x "$(command -v run-clang-tidy)" ]]; then + echo "Using run-clang-tidy from $(command -v run-clang-tidy)" + CLANG_TIDY=(run-clang-tidy) + else + echo "Downloading run-clang-tidy script" + LLVM_MAJOR="$(clang-tidy --version | sed -nE 's/.*version ([0-9]+).*/\1/p')" + LLVM_BRANCH="release/${LLVM_MAJOR}.x" + curl -fsSL -o run-clang-tidy.py "https://raw.githubusercontent.com/llvm/llvm-project/refs/heads/${LLVM_BRANCH}/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py" + CLANG_TIDY=(uv run --no-project --script -- run-clang-tidy.py) + fi + if [[ -x "$(command -v clang-apply-replacements)" ]]; then + echo "Using clang-apply-replacements from $(command -v clang-apply-replacements)" + CLANG_TIDY+=(-fix -clang-apply-replacements-binary="$(command -v clang-apply-replacements)") + else + echo "::warning::clang-apply-replacements not found in PATH, automatic fixing disabled." + fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test for Python 3.12 with Nightly-ROCm-7.0 (on self-hosted-amd)
- GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.github/workflows/ci.yml (2)
322-324
: Gatecmake --fresh
behind a capability check.Older CMake releases (common on self-hosted runners) do not recognize
--fresh
, so this step will fail before we obtaincompile_commands.json
. Fall back torm -rf cmake-build && cmake …
when--fresh
is unavailable.Suggested change:
- cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + if cmake --help 2>/dev/null | grep -q -- '--fresh'; then + cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + else + rm -rf cmake-build + cmake -S . -B cmake-build ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + fi
325-329
: Only feed translation units to clang-tidy.The current
find
includes headers (*.h
,*.hpp
) that have no compile command;clang-tidy
exits with “Error while processing…” and the workflow fails. Extract the translation units listed incompile_commands.json
(e.g.,.c
,.cc
,.cpp
,.cxx
,.cu
) instead of scanning headers.One option:
- CXX_FILES=$(find src -type f -iname "*.[ch]pp" -o -iname "*.cc" -o -iname "*.c" -o -iname "*.h") - "${CLANG_TIDY[@]}" -clang-tidy-binary="$(command -v clang-tidy)" \ - -p="cmake-build" ${CXX_FILES} || rc="$?" + mapfile -t CXX_FILES < <(python - <<'PY' +import json, os +with open("cmake-build/compile_commands.json") as fh: + seen = [] + exts = {".c", ".cc", ".cpp", ".cxx", ".cu"} + for entry in json.load(fh): + path = entry["file"] + if os.path.splitext(path)[1] in exts and path not in seen: + seen.append(path) +for path in seen: + print(path) +PY +) + if ((${#CXX_FILES[@]} == 0)); then + echo "::error::No translation units found in compile_commands.json" + exit 1 + fi + "${CLANG_TIDY[@]}" -clang-tidy-binary="$(command -v clang-tidy)" \ + -p="cmake-build" "${CXX_FILES[@]}" || rc="$?"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Test for Python 3.12 with CUDA-12.8 (on self-hosted-nvidia)
- GitHub Check: Test for Python 3.12 with Nightly-ROCm-7.0 (on self-hosted-amd)
- GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
138457d
to
23a43a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (2)
.github/workflows/ci.yml (2)
323-323
: Add fallback for older CMake when --fresh is unsupported.- cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + if cmake --help 2>/dev/null | grep -q -- '--fresh'; then + cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + else + rm -rf cmake-build + cmake -S . -B cmake-build ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + fiBased on past review comment.
325-325
: Restrict clang-tidy inputs to translation units (exclude headers).Feeding headers that lack compile commands causes clang-tidy to error. Use only TU extensions.
- CXX_FILES=$(find src -type f -iname "*.[ch]pp" -o -iname "*.cc" -o -iname "*.c" -o -iname "*.h") + CXX_FILES=$(find src -type f \( -iname "*.c" -o -iname "*.cc" -o -iname "*.cpp" -o -iname "*.cxx" \))(Optional: extract from compile_commands.json for exact TUs.)
1a76e51
to
743b42b
Compare
743b42b
to
dfd1c30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.clang-tidy (1)
10-58
: Resolve conflicting enable/disable checks to avoid ambiguity.You enable several checks and later disable the same ones. Order-dependent outcomes are brittle. Remove duplicates so intent is clear.
Apply:
# 1. Retained categories: easier to find bugs/performance issues clang-analyzer-*, - cppcoreguidelines-pro-type-static-cast-downcast, - cppcoreguidelines-pro-type-member-init, - cppcoreguidelines-pro-bounds-array-to-pointer-decay, - cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-slicing, - cppcoreguidelines-narrowing-conversions, performance-*,This keeps the explicit disables below authoritative and removes contradictions.
♻️ Duplicate comments (2)
.github/workflows/ci.yml (2)
313-313
: Add fallback whencmake --fresh
is unavailable.Self-hosted runners may have CMake < 3.24;
--fresh
will fail and break the job. Add a capability check and fallback.Apply:
- cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + if cmake --help 2>/dev/null | grep -q -- '--fresh'; then + cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + else + rm -rf cmake-build + cmake -S . -B cmake-build ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here + fi
315-319
: Don’t feed headers to clang-tidy; use compile_commands.json (prevents failures and ARG_MAX issues).Passing
*.h
/*.hpp
causes “Error while processing …” for headers without compile commands and risks long arg lists. Let run-clang-tidy enumerate TUs from-p
instead.Preferred:
- CXX_FILES=$(find src -type f -iname "*.[ch]pp" -o -iname "*.cc" -o -iname "*.c" -o -iname "*.h") - rc=0 - "${CLANG_TIDY[@]}" -clang-tidy-binary="$(command -v clang-tidy)" \ - -p="cmake-build" ${CXX_FILES} || rc="$?" + rc=0 + # Let run-clang-tidy traverse all translation units from compile_commands.json + "${CLANG_TIDY[@]}" -clang-tidy-binary="$(command -v clang-tidy)" -p="cmake-build" || rc="$?"If you must pass files, at least restrict to TUs:
- CXX_FILES=$(find src -type f -iname "*.[ch]pp" -o -iname "*.cc" -o -iname "*.c" -o -iname "*.h") + CXX_FILES=$(find src -type f \( -iname "*.c" -o -iname "*.cc" -o -iname "*.cpp" -o -iname "*.cxx" \))
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
320-323
: Improve failure hint for local reproduction.Recommend the exact repro command users should run.
- echo "::error::clang-tidy found issues (exit code: ${rc}). Please run 'clang-tidy --fix' locally to fix them." + echo "::error::clang-tidy found issues (exit code: ${rc}). Reproduce locally with:" + echo " cmake -S . -B cmake-build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" + echo " run-clang-tidy -p cmake-build -fix -clang-apply-replacements-binary=\$(command -v clang-apply-replacements)"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
.clang-tidy
(1 hunks).github/workflows/ci.yml
(2 hunks).gitignore
(1 hunks).pre-commit-config.yaml
(1 hunks)format.sh
(0 hunks)requirements-lint.txt
(1 hunks)src/layout/utils.cc
(1 hunks)src/op/gemm.cc
(1 hunks)src/op/parallel.h
(1 hunks)src/runtime/runtime.cc
(1 hunks)src/target/codegen_cuda.cc
(1 hunks)src/target/codegen_webgpu.cc
(1 hunks)src/target/cuda.h
(1 hunks)src/tl_templates/cpp/half.hpp
(2 hunks)src/tl_templates/cuda/common.h
(1 hunks)src/transform/cluster_planning.cc
(1 hunks)src/transform/common/loop_fusion_utils.h
(1 hunks)src/transform/layout_inference.cc
(3 hunks)src/transform/layout_reducer.cc
(1 hunks)src/transform/lower_thread_allreduce.cc
(4 hunks)src/transform/make_packed_api.cc
(1 hunks)src/transform/storage_access.cc
(1 hunks)src/transform/warp_specialized_rewriter.cc
(4 hunks)
💤 Files with no reviewable changes (1)
- format.sh
✅ Files skipped from review due to trivial changes (4)
- src/transform/common/loop_fusion_utils.h
- src/layout/utils.cc
- src/op/parallel.h
- requirements-lint.txt
🚧 Files skipped from review as they are similar to previous changes (12)
- src/runtime/runtime.cc
- src/transform/layout_reducer.cc
- src/transform/cluster_planning.cc
- src/op/gemm.cc
- src/tl_templates/cpp/half.hpp
- src/transform/storage_access.cc
- src/target/codegen_webgpu.cc
- .pre-commit-config.yaml
- .gitignore
- src/transform/layout_inference.cc
- src/target/codegen_cuda.cc
- src/tl_templates/cuda/common.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Test for Python 3.12 with Nightly-ROCm-7.0 (on self-hosted-amd)
- GitHub Check: Test for Python 3.12 with CUDA-12.8 (on self-hosted-nvidia)
- GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
🔇 Additional comments (10)
src/target/cuda.h (1)
5026-5031
: LGTM! Formatting improvements from clang-tidy.The spacing around the binary minus operator now aligns with standard C/C++ formatting conventions. These changes are purely stylistic with no functional impact.
src/transform/make_packed_api.cc (1)
480-480
: LGTM: Efficient binding avoids copy.Binding
opt.value()
as a const reference instead of copying is appropriate here, as theprim_func
is only read in the subsequent call toRequiresPackedAPI
.src/transform/lower_thread_allreduce.cc (2)
499-501
: LGTM: Preallocating and constructing in place.Reserving capacity upfront and using
emplace_back
instead ofpush_back
are solid optimizations that avoid unnecessary reallocations and temporary object creation.
608-608
: LGTM: Const reference bindings eliminate copies.Binding
shared_bufs[i]
andlocal_bufs[i]
as const references instead of by value avoids unnecessary Buffer copies. These variables are only read in subsequent operations, so const ref is both safe and efficient.Also applies to: 627-627, 643-643
src/transform/warp_specialized_rewriter.cc (4)
533-537
: LGTM - Appropriate clang-tidy suppression.The ternary expression preserves the original semantics, and the
NOLINTNEXTLINE
suppression forperformance-move-const-arg
is appropriate here. The move is valid sinceblock_stmt
is not const and won't be used after constructing theSeqStmt
.
701-706
: LGTM - Consistent pattern.This change follows the same pattern as line 533, correctly preserving semantics while addressing clang-tidy formatting requirements.
740-745
: LGTM.Consistent application of the ternary pattern with appropriate suppression.
774-778
: LGTM - Formatting update complete.Final instance of the consistent ternary pattern. All changes in this file are localized, preserve semantics, and appropriately integrate clang-tidy requirements.
.github/workflows/ci.yml (1)
297-310
: Good: gate -fix behind clang-apply-replacements.Initialization no longer pre-seeds -fix and only adds it when the replacement tool exists. This avoids failures and duplication.
.clang-tidy (1)
2-7
: Verify ExcludeHeaderFilterRegex support in CI clang-tidy
The sandbox lacked clang-tidy, so confirm your CI runner’s version recognizesExcludeHeaderFilterRegex
. If not, replace with a compatibleHeaderFilterRegex
:-ExcludeHeaderFilterRegex: '^(3rdparty|tvm)/.*$' +HeaderFilterRegex: '^(?!3rdparty/|tvm/).*$'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to maintain format.p referable, as it is more convenient though provides similar functionality to pre-commit. Developers should not be forced to install pre-commit
when they're developing; instead, we could modify the content of format.sh
to install and run pre-commit directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving format.sh
as a Makefile
with the following target (Unix-like systems always have make
executable):
make format
We can add more targets like:
make install
make docs
make test
make clang-tidy
make clean
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened a new PR to resolve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Summary by CodeRabbit
Chores
Style