From 0df961867d5503e7c47724634b9cb88ebbfa8ae4 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Fri, 15 Nov 2024 15:52:21 +0000 Subject: [PATCH] Set clangd, clang-tidy and cppcheck to c++23 mode (#154) --- .clang-tidy | 5 +++-- .clangd | 4 +++- .github/workflows/ci-checks.yml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1be73aa59..2351c5023 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -41,6 +41,7 @@ Checks: > -misc-no-recursion, -misc-non-private-member-variables-in-classes, -modernize-use-ranges, + -modernize-use-std-print, # replace printout macro with a function when we want to autofix to use std::format gcc >=13 -performance-enum-size, -readability-identifier-length, -readability-function-cognitive-complexity, @@ -48,7 +49,7 @@ Checks: > WarningsAsErrors: > *, FormatStyle: file -ExtraArgs: [-std=c++20] +ExtraArgs: [-std=c++23] CheckOptions: - key: modernize-deprecated-headers.CheckHeaderFile value: 'true' @@ -56,7 +57,7 @@ CheckOptions: value: google - key: cppcoreguidelines-init-variables.MathHeader value: - - key: modernize-use-std-print.PrintfLikeFunctions # replace printout macro with a function when we want to autofix to use std::format gcc >=13 + - key: modernize-use-std-print.PrintfLikeFunctions value: printf; absl::PrintF; printout - key: modernize-use-std-print.FprintfLikeFunctions value: fprintf; absl::FPrintF diff --git a/.clangd b/.clangd index 2cea2fc80..c92409e82 100644 --- a/.clangd +++ b/.clangd @@ -2,11 +2,13 @@ CompileFlags: # to make the compilation database, pip install compiledb, then run: # compiledb -n --full-path make TESTMODE=ON CompilationDatabase: compile_commands.json - Add: [-xc++, -std=c++20, -DTESTMODE=true] + Add: [-xc++, -std=c++23, -DTESTMODE=true] Diagnostics: ClangTidy: FastCheckFilter: None + Remove: + performance-enum-size UnusedIncludes: Strict MissingIncludes: Strict Includes: diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 11f7add75..5209bb225 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -23,7 +23,7 @@ jobs: - name: run cppcheck run: | cppcheck --version - cppcheck --force --error-exitcode=1 --language=c++ --std=c++20 --enable=all --inconclusive --suppress=knownConditionTrueFalse --suppress=constParameterCallback --suppress=redundantAssignment --suppress=knownArgument --suppress=missingIncludeSystem --suppress=unusedFunction --check-level=exhaustive . + cppcheck --force --error-exitcode=1 --language=c++ --enable=all --inconclusive --suppress=knownConditionTrueFalse --suppress=constParameterCallback --suppress=redundantAssignment --suppress=knownArgument --suppress=missingIncludeSystem --suppress=unusedFunction --check-level=exhaustive . clang-format: runs-on: macos-15