From 14e2c1c4cf4713a36457a00da0297a7ddf7d9fab Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sun, 15 Mar 2026 20:42:35 -0700 Subject: [PATCH] [ci] Fix all warnings from clang-tidy 22 (#8680) I ran the following locally: ```bash gradle generateCompileCommands ./.github/workflows/fix_compile_commands.py build/TargetedCompileCommands/linuxx86-64release/compile_commands.json wpiformat -default-branch 2027 -no-format -tidy-all -compile-commands=build/TargetedCompileCommands/linuxx86-64release ``` The `HeaderFilterRegex` option is used to filter out warnings from thirdparty headers. --- .clang-tidy | 1 + .github/workflows/lint-format.yml | 4 ++-- hal/src/main/native/include/wpi/hal/.clang-tidy | 1 + ntcore/.clang-tidy | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1c902d5b9e..96e1f14dce 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -72,3 +72,4 @@ CheckOptions: - key: modernize-use-using.IgnoreExternC value: 'true' FormatStyle: file +HeaderFilterRegex: '^((?!thirdparty/).)*$' diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 36b50edf9b..941744d5cb 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -36,7 +36,7 @@ jobs: - name: Install wpiformat run: | python -m venv ${{ runner.temp }}/wpiformat - ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2026.56 + ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2026.57 - name: Run run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027 - name: Check output @@ -78,7 +78,7 @@ jobs: - name: Install wpiformat run: | python -m venv ${{ runner.temp }}/wpiformat - ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2026.56 + ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2026.57 - name: Create compile_commands.json run: | ./gradlew generateCompileCommands -Ptoolchain-optional-roboRio diff --git a/hal/src/main/native/include/wpi/hal/.clang-tidy b/hal/src/main/native/include/wpi/hal/.clang-tidy index 26312851e9..c551a3cc12 100644 --- a/hal/src/main/native/include/wpi/hal/.clang-tidy +++ b/hal/src/main/native/include/wpi/hal/.clang-tidy @@ -71,3 +71,4 @@ FormatStyle: file CheckOptions: - key: bugprone-dangling-handle value: 'std::string_view' +HeaderFilterRegex: '^((?!thirdparty/).)*$' diff --git a/ntcore/.clang-tidy b/ntcore/.clang-tidy index 59a5681cb7..fe0d5e6a9f 100644 --- a/ntcore/.clang-tidy +++ b/ntcore/.clang-tidy @@ -67,4 +67,8 @@ Checks: modernize-use-override, modernize-use-using, readability-braces-around-statements' +CheckOptions: + - key: modernize-use-using.IgnoreExternC + value: 'true' FormatStyle: file +HeaderFilterRegex: '^((?!thirdparty/).)*$'