Skip to content

Commit 6ab0d66

Browse files
committed
[Lint] Retire format.sh and add clang-tidy to GHA workflow
1 parent 8ce2778 commit 6ab0d66

File tree

3 files changed

+22
-343
lines changed

3 files changed

+22
-343
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,27 @@ jobs:
287287
echo "Clearing uv cache at ${UV_CACHE_DIR} due to failure."
288288
uv cache clean
289289
290-
- name: Run format check
291-
id: format-check
290+
- name: Run clang-tidy
291+
id: clang-tidy
292292
run: |
293-
mkdir -p build
293+
clang-tidy --version
294+
294295
# Run cmake to create the build directory with compile_commands.json
295-
(
296-
cd build
297-
cmake .. ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here
298-
)
296+
cmake -S . -B cmake-build --fresh ${CLANG_TIDY_CMAKE_OPTIONS} # no quotes here
297+
298+
CXX_FILES=$(find src -type f -iname "*.[ch]pp" -o -iname "*.cc" -o -iname "*.c" -o -iname "*.h")
299299
rc=0
300-
bash format.sh || rc="$?"
301-
rm -rf build
302-
if [[ "${rc}" -ne 0 ]]; then
303-
echo "::error::Format check failed. Please run 'bash format.sh' locally to fix the issues."
304-
exit 1
300+
if [[ -x "$(command -v run-clang-tidy)" ]]; then
301+
run-clang-tidy -clang-tidy-binary="$(command -v clang-tidy)" \
302+
-fix -p="cmake-build" ${CXX_FILES} || rc="$?"
303+
else
304+
clang-tidy --fix -p="cmake-build" ${CXX_FILES} || rc="$?"
305+
fi
306+
rm -rf cmake-build
307+
if (( rc != 0 )); then
308+
echo "::error::clang-tidy found issues (exit code: ${rc}). Please run 'clang-tidy --fix' locally to fix them."
309+
git diff --color=always || true
310+
exit "${rc}"
305311
fi
306312
307313
- name: Enable core dump generation (Linux / GitHub-hosted runners)

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,7 @@ tilelang/jit/adapter/cython/.cycache
9797

9898
# claude
9999
**/.claude
100+
101+
# CMake
102+
cmake-build/
103+
cmake-build-*/

format.sh

Lines changed: 0 additions & 331 deletions
This file was deleted.

0 commit comments

Comments
 (0)