From f6382690b4ba1fa82931b1e85409e89fe1bdc7e0 Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sat, 7 Mar 2026 13:53:01 +0100 Subject: [PATCH 1/3] Fix indentation for workflow_dispatch in CI build --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index ebac4e4..a2d65bc 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -3,7 +3,7 @@ name: CI Build on: pull_request: - workflow_dispatch: + workflow_dispatch: jobs: build: From b4161e84e194e1793bb76fbd477c0c7bc4d82205 Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sat, 7 Mar 2026 13:58:28 +0100 Subject: [PATCH 2/3] Add linting and static analysis workflow --- .github/workflows/ci-build.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index a2d65bc..5c24d1c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -40,3 +40,37 @@ jobs: ./build/ace-qwen3 --help 2>&1 | head -5 ./build/dit-vae --help 2>&1 | head -5 ./build/quantize --help 2>&1 | head -3 + + lint: + name: Lint & Static Analysis + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + + - name: Install lint tools + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq clang-format clang-tidy cppcheck + + - name: Check trailing whitespace + continue-on-error: true + run: | + if grep -rIn --exclude-dir=.git --exclude="*.md" "[[:blank:]]$" .; then + echo "Trailing whitespace detected!" + exit 1 + fi + + - name: Run clang-format (check mode) + run: | + find . \( -name '*.cpp' -o -name '*.hpp' -o -name '*.cc' -o -name '*.h' \) \ + -exec clang-format --dry-run --Werror {} + + + - name: Run cppcheck + run: | + cppcheck --enable=all --error-exitcode=1 --inline-suppr \ + --suppress=missingIncludeSystem . + + - name: Run clang-tidy (basic checks) + run: | + find . \( -name '*.cpp' -o -name '*.cc' \) -print0 | xargs -0 -n1 clang-tidy || true From c1ebc1df963e82534c6a854d91e0764bb001e21b Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sat, 7 Mar 2026 14:09:25 +0100 Subject: [PATCH 3/3] Update CI workflow --- .github/workflows/ci-build.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 5c24d1c..aa85ae6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -56,21 +56,22 @@ jobs: - name: Check trailing whitespace continue-on-error: true run: | - if grep -rIn --exclude-dir=.git --exclude="*.md" "[[:blank:]]$" .; then + if grep -rIn --exclude-dir=.git --exclude="*.md,*.log" "[[:blank:]]$" .; then echo "Trailing whitespace detected!" exit 1 fi - name: Run clang-format (check mode) run: | - find . \( -name '*.cpp' -o -name '*.hpp' -o -name '*.cc' -o -name '*.h' \) \ - -exec clang-format --dry-run --Werror {} + - + find . \ + \( -path './.git' -o -path './ggml' -o -path './build' \) -prune -o \ + -type f \( -name '*.c' -o -name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.hpp' \) \ + -print0 | xargs -0 clang-format --dry-run --Werror + - name: Run cppcheck run: | cppcheck --enable=all --error-exitcode=1 --inline-suppr \ - --suppress=missingIncludeSystem . - - - name: Run clang-tidy (basic checks) - run: | - find . \( -name '*.cpp' -o -name '*.cc' \) -print0 | xargs -0 -n1 clang-tidy || true + --suppress=missingIncludeSystem \ + --suppress=unusedFunction \ + -i ggml -i build -i .git \ + .