Skip to content

Commit

Permalink
Set clangd, clang-tidy and cppcheck to c++23 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Nov 15, 2024
1 parent 1d6cf2f commit 5e3cf5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,23 @@ 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,
-readability-magic-numbers,
WarningsAsErrors: >
*,
FormatStyle: file
ExtraArgs: [-std=c++20]
ExtraArgs: [-std=c++23]
CheckOptions:
- key: modernize-deprecated-headers.CheckHeaderFile
value: 'true'
- key: cppcoreguidelines-init-variables.IncludeStyle
value: google
- key: cppcoreguidelines-init-variables.MathHeader
value: <cmath>
- 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
Expand Down
2 changes: 1 addition & 1 deletion .clangd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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++ --std=c++23 --enable=all --inconclusive --suppress=knownConditionTrueFalse --suppress=constParameterCallback --suppress=redundantAssignment --suppress=negativeContainerIndex --suppress=missingIncludeSystem --suppress=unusedFunction --check-level=exhaustive .
clang-format:
runs-on: macos-15
Expand Down

0 comments on commit 5e3cf5b

Please sign in to comment.