From f74a44ab4f92813d80902d8af30a41fb9ee25075 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 9 Feb 2025 11:19:45 -0600 Subject: [PATCH] CI: Update linter settings * Updates Clazy to only run on changed files * Ensures clazy does not analyze #included files * Disables a few unnecessary cpplint checks --- .github/workflows/sub_lint.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sub_lint.yml b/.github/workflows/sub_lint.yml index 3b2a90cd20..ab28e819da 100644 --- a/.github/workflows/sub_lint.yml +++ b/.github/workflows/sub_lint.yml @@ -83,7 +83,7 @@ on: -build/endif_comment, +build/explicit_make_pair, -build/forward_decl, - +build/header_guard, + -build/header_guard, +build/include, -build/include_subdir, -build/include_alpha, @@ -91,9 +91,10 @@ on: +build/include_what_you_use, +build/namespaces_headers, +build/namespaces_literals, - +build/namespaces, + -build/namespaces, +build/printf_format, +build/storage_class, + -legal/copyright, +readability/alt_tokens, -readability/braces, +readability/casting, @@ -728,14 +729,19 @@ jobs: - name: Clazy if: inputs.checkClazy && inputs.changedCppFiles != '' && always() continue-on-error: ${{ inputs.clazyFailSilent }} + env: + CLAZY_HEADER_FILTER: "^$" run: | clazyErrors=0 clazyWarnings=0 clazyNotes=0 sudo apt-get install -y --no-install-recommends clazy #TODO: check where this "clazy.yaml" goes ; shall this be put in the fixes ? - # Run clazy on all cpp files - clazy-standalone --export-fixes=clazy.yaml -checks=${{ inputs.clazyChecks }} -p build/ ${{ inputs.changedCppFiles }} &>> ${{ env.logdir }}clazy.log || true + # Run clazy on all changed cpp files, ignoring any included headers + for file in ${{ inputs.changedCppFiles }} + do + clazy-standalone --export-fixes=clazy.yaml -checks=${{ inputs.clazyChecks }} -p build/compile_commands.json $file &>> ${{ env.logdir }}clazy.log || true + done # If clazy has run successfully, write the Log to the console with the Problem Matchers if [ -f ${{ env.logdir }}clazy.log ] then