include all (internal non-generated) headers in clang-tidy checks (#4100)

This commit is contained in:
Oliver Stöneberg 2022-10-16 13:51:17 +02:00 committed by GitHub
parent 3273e51fd5
commit 2ac9fbc1bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,7 @@
--- ---
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics' Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics'
WarningsAsErrors: '*' WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
CheckOptions: CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1' value: '1'

View File

@ -37,6 +37,7 @@ struct Analyzer {
template<class T, template<class T,
REQUIRES("T must be convertible to unsigned int", std::is_convertible<T, unsigned int> ), REQUIRES("T must be convertible to unsigned int", std::is_convertible<T, unsigned int> ),
REQUIRES("T must not be a bool", !std::is_same<T, bool> )> REQUIRES("T must not be a bool", !std::is_same<T, bool> )>
// NOLINTNEXTLINE(google-explicit-constructor)
Action(T f) : mFlag(f) // cppcheck-suppress noExplicitConstructor Action(T f) : mFlag(f) // cppcheck-suppress noExplicitConstructor
{} {}

View File

@ -40,9 +40,11 @@ struct ExprIdToken {
ExprIdToken() = default; ExprIdToken() = default;
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ExprIdToken(const Token* tok) : tok(tok) {} ExprIdToken(const Token* tok) : tok(tok) {}
// TODO: Make this constructor only available from ProgramMemory // TODO: Make this constructor only available from ProgramMemory
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ExprIdToken(nonneg int exprid) : exprid(exprid) {} ExprIdToken(nonneg int exprid) : exprid(exprid) {}
nonneg int getExpressionId() const; nonneg int getExpressionId() const;

View File

@ -37,6 +37,7 @@ struct TaggedAllocator : std::allocator<T>
{ {
template<class ... Ts> template<class ... Ts>
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
TaggedAllocator(Ts&&... ts) TaggedAllocator(Ts&&... ts)
: std::allocator<T>(std::forward<Ts>(ts)...) : std::allocator<T>(std::forward<Ts>(ts)...)
{} {}
@ -47,6 +48,7 @@ class SmallVector : public std::vector<T, TaggedAllocator<T, N>>
{ {
public: public:
template<class ... Ts> template<class ... Ts>
// NOLINTNEXTLINE(google-explicit-constructor)
SmallVector(Ts&&... ts) SmallVector(Ts&&... ts)
: std::vector<T, TaggedAllocator<T, N>>(std::forward<Ts>(ts)...) : std::vector<T, TaggedAllocator<T, N>>(std::forward<Ts>(ts)...)
{ {

View File

@ -1216,7 +1216,7 @@ public:
void removeValues(std::function<bool(const ValueFlow::Value &)> pred) { void removeValues(std::function<bool(const ValueFlow::Value &)> pred) {
if (mImpl->mValues) if (mImpl->mValues)
mImpl->mValues->remove_if(pred); mImpl->mValues->remove_if(std::move(pred));
} }
nonneg int index() const { nonneg int index() const {

View File

@ -42,6 +42,7 @@ public:
template<class U> template<class U>
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ValuePtr(const U& value) : mPtr(cloner<U>::apply(&value)), mClone(&cloner<U>::apply) ValuePtr(const U& value) : mPtr(cloner<U>::apply(&value)), mClone(&cloner<U>::apply)
{} {}
@ -91,6 +92,7 @@ public:
return *this; return *this;
} }
// NOLINTNEXTLINE(google-explicit-constructor)
operator bool() const NOEXCEPT { operator bool() const NOEXCEPT {
return !!mPtr; return !!mPtr;
} }

View File

@ -21,7 +21,9 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
// NOLINTNEXTLINE(readability-redundant-declaration) - TODO: fix this
extern std::ostringstream errout; extern std::ostringstream errout;
// NOLINTNEXTLINE(readability-redundant-declaration) - TODO: fix this
extern std::ostringstream output; extern std::ostringstream output;
/** /**
* @brief Utility class for capturing cout and cerr to ostringstream buffers * @brief Utility class for capturing cout and cerr to ostringstream buffers