config.yaml for user (home directory)
settings.json
is for vscode.
.clang-tidy
should located in project root or use .clangd
Ref:
Checks: 'clang-analyzer-*,bugprone-*,modernize-*,performance-*,portability-*,readability-*,cert-*,cppcoreguidelines-*,google-*,llvm-*' | |
FormatStyle: llvm |
# https://clangd.llvm.org/config | |
Diagnostics: | |
ClangTidy: | |
Add: | |
[ | |
clang-analyzer-*, | |
cppcoreguidelines-*, | |
bugprone-*, | |
performance-*, | |
modernize-*, | |
portability-*, | |
readability-*', | |
cert-*, | |
llvm-*, | |
google-*, | |
] | |
Remove: | |
[ | |
modernize-use-trailing-return-type, | |
cppcoreguidelines-avoid-magic-numbers, | |
] | |
CheckOptions: | |
WarnOnFloatingPointNarrowingConversion: false | |
config.yaml for user (home directory)
settings.json
is for vscode.
.clang-tidy
should located in project root or use .clangd
Ref:
# https://clangd.llvm.org/config | |
CompileFlags: | |
Add: [-ferror-limit=0, -Wall] | |
InlayHints: | |
Enabled: Yes | |
ParameterNames: Yes | |
Designators: Yes | |
DeducedTypes: Yes | |
# BlockEnd: Yes | |
# TypeNameLimit: 24 | |
Hover: | |
ShowAKA: Yes | |
Diagnostics: | |
UnusedIncludes: Strict | |
# MissingIncludes: Strict |
// vscode clangd extention settings | |
"clangd.arguments": [ | |
"--background-index", | |
"-j=16", | |
"--clang-tidy", | |
// "--compile-commands-dir=build", | |
// "--query-driver=/usr/bin/clang++", | |
"--all-scopes-completion", | |
"--completion-style=detailed", | |
"--header-insertion=iwyu", | |
"--pch-storage=memory", | |
"--offset-encoding=utf-8", | |
"--fallback-style=LLVM", | |
// "--log=verbose" | |
], |