mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
build: adjust clang-tidy warning exclusion logic
Enable all clang-tidy warnings by default instead of disabling them. This ensures that we don't miss useful warnings on each clang-tidy version upgrade. A drawback of this is that it will force us to either fix or adjust the warnings as soon as possible.
This commit is contained in:
90
.clang-tidy
90
.clang-tidy
@ -1,49 +1,71 @@
|
||||
WarningsAsErrors: '*'
|
||||
WarningsAsErrors: '*,-clang-diagnostic-unused-function'
|
||||
Checks: >
|
||||
-*,
|
||||
Enable all warnings by default. This ensures we don't miss new and useful
|
||||
warnings when a new version of clang-tidy is dropped.
|
||||
|
||||
bugprone-*,
|
||||
google-*,
|
||||
misc-*,
|
||||
modernize-*,
|
||||
performance-*,
|
||||
portability-*,
|
||||
readability-*,
|
||||
IMPORTANT
|
||||
clang-tidy doesn't support comments but we can simulate comments by just
|
||||
writing text directly here. These are then interpreted as warnings and will
|
||||
be dropped. As long as you start every sentence with a capital letter and
|
||||
don't use commas in your "comments" you should be fine,
|
||||
*,
|
||||
|
||||
Untriaged warnings. Please categorize them accordingly if you find a relevant
|
||||
section for it,
|
||||
-bugprone-assignment-in-if-condition,
|
||||
-bugprone-branch-clone,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-implicit-widening-of-multiplication-result,
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-not-null-terminated-result,
|
||||
-bugprone-reserved-identifier,
|
||||
-bugprone-sizeof-expression,
|
||||
-bugprone-suspicious-memory-comparison,
|
||||
-bugprone-swapped-arguments,
|
||||
-bugprone-switch-missing-default-case,
|
||||
-bugprone-unsafe-functions,
|
||||
-bugprone-unused-return-value,
|
||||
-google-readability-braces-around-statements,
|
||||
-google-readability-function-size,
|
||||
-misc-header-include-cycle,
|
||||
-misc-include-cleaner,
|
||||
-misc-misplaced-const,
|
||||
-misc-no-recursion,
|
||||
-cert-env33-c,
|
||||
-cert-err33-c,
|
||||
-cert-err34-c,
|
||||
-concurrency-mt-unsafe,
|
||||
-cppcoreguidelines-narrowing-conversions,
|
||||
|
||||
Warnings that may be useful, but are too inconsistent to enable by default
|
||||
May yield useful results with some manual triaging,
|
||||
-bugprone-branch-clone,
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-sizeof-expression,
|
||||
-hicpp-multiway-paths-covered,
|
||||
-hicpp-signed-bitwise,
|
||||
-misc-unused-parameters,
|
||||
-modernize-macro-to-enum,
|
||||
-performance-no-int-to-ptr,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-avoid-unconditional-preprocessor-if,
|
||||
-readability-braces-around-statements,
|
||||
-readability-else-after-return,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-length,
|
||||
-readability-isolate-declaration,
|
||||
|
||||
Warnings that are rarely useful,
|
||||
-altera-*, Checks related to OpenCL programming for FPGAs. Not relevant,
|
||||
-android-*,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-swapped-arguments,
|
||||
-clang-analyzer-*, Already covered by the cmake target "clang-analyzer",
|
||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||
-cppcoreguidelines-init-variables,
|
||||
-llvm-header-guard, We use #pragma once,
|
||||
-llvmlibc-restrict-system-libc-headers, We want to use glibc,
|
||||
-misc-header-include-cycle, Looks useful but redundant with IWYU. We may replace IWYU with this one day,
|
||||
-misc-include-cleaner, Looks useful but redundant with IWYU. We may replace IWYU with this one day,
|
||||
-misc-misplaced-const,
|
||||
-misc-no-recursion,
|
||||
-performance-no-int-to-ptr,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-identifier-length,
|
||||
-readability-magic-numbers,
|
||||
-readability-misleading-indentation,
|
||||
-readability-non-const-parameter,
|
||||
-readability-redundant-declaration,
|
||||
-readability-redundant-function-ptr-dereference,
|
||||
-readability-redundant-declaration, Conflicts with our header generation scripts,
|
||||
-readability-suspicious-call-argument,
|
||||
|
||||
Aliases. These are just duplicates of other warnings and should always be ignored,
|
||||
-bugprone-narrowing-conversions,
|
||||
-cert-dcl37-c,
|
||||
-cert-dcl51-cpp,
|
||||
-cert-exp42-c,
|
||||
-cert-flp37-c,
|
||||
-cert-msc24-c,
|
||||
-cert-msc33-c,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-google-readability-function-size,
|
||||
-hicpp-function-size,
|
||||
-llvm-else-after-return,
|
||||
|
Reference in New Issue
Block a user