Files
qt-creator/src/plugins/cpptools/cpptools_clangtidychecks.h
Ivan Donchevskii 3c1565efcb Clang: Fix build with clang 7.0
As an addition update the header with Clang-Tidy checks.

Change-Id: Ib4a4d324e8cad95403a3e799e352205b05ed7475
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-17 05:56:51 +00:00

714 lines
22 KiB
C++

/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <vector>
namespace CppTools {
namespace Constants {
struct TidyNode
{
const std::vector<TidyNode> children;
const char *name = nullptr;
TidyNode(const char *name, std::vector<TidyNode> &&children)
: children(std::move(children))
, name(name)
{}
TidyNode(const char *name) : name(name) {}
};
// CLANG-UPGRADE-CHECK: Run 'scripts/generateClangTidyChecks.py' after Clang upgrade to
// update this header.
static const TidyNode CLANG_TIDY_CHECKS_ROOT
{
"",
{
{
"android-",
{
"tring-find-startswith",
{
"cloexec-",
{
"accept",
"accept4",
"creat",
"dup",
{
"epoll-",
{
"create",
"create1"
}
},
"fopen",
{
"inotify-",
{
"init",
"init1"
}
},
"memfd-create",
"open",
"socket"
}
},
"comparison-in-temp-failure-retry"
}
},
{
"boost-",
{
"use-to-string"
}
},
{
"bugprone-",
{
"argument-comment",
"assert-side-effect",
"bool-pointer-implicit-conversion",
"copy-constructor-init",
"dangling-handle",
"exception-escape",
"fold-init-type",
"forward-declaration-namespace",
"forwarding-reference-overload",
"inaccurate-erase",
"incorrect-roundings",
"integer-division",
"lambda-function-name",
{
"macro-",
{
"parentheses",
"repeated-side-effects"
}
},
{
"misplaced-",
{
"operator-in-strlen-in-alloc",
"widening-cast"
}
},
"move-forwarding-reference",
"multiple-statement-macro",
"narrowing-conversions",
"parent-virtual-call",
{
"sizeof-",
{
"container",
"expression"
}
},
{
"string-",
{
"constructor",
"integer-assignment",
"literal-with-embedded-nul"
}
},
{
"suspicious-",
{
"enum-usage",
"memset-usage",
"missing-comma",
"semicolon",
"string-compare"
}
},
"swapped-arguments",
"terminating-continue",
"throw-keyword-missing",
"undefined-memory-manipulation",
"undelegated-constructor",
{
"unused-",
{
"raii",
"return-value"
}
},
"use-after-move",
"virtual-near-miss"
}
},
{
"cert-",
{
"dcl03-c",
"dcl21-cpp",
"dcl50-cpp",
"dcl54-cpp",
"dcl58-cpp",
"dcl59-cpp",
"env33-c",
"err09-cpp",
"err34-c",
"err52-cpp",
"err58-cpp",
"err60-cpp",
"err61-cpp",
"fio38-c",
"flp30-c",
"msc30-c",
"msc32-c",
"msc50-cpp",
"msc51-cpp",
"oop11-cpp"
}
},
{
"clang-analyzer-",
{
{
"apiModeling.",
{
"TrustNonnull",
"google.GTest"
}
},
{
"core.",
{
"CallAndMessage",
"DivideZero",
"DynamicTypePropagation",
"NonNullParamChecker",
"NonnilStringConstants",
"NullDereference",
"StackAddressEscape",
"UndefinedBinaryOperatorResult",
"VLASize",
{
"builtin.",
{
"BuiltinFunctions",
"NoReturnFunctions"
}
},
{
"uninitialized.",
{
"ArraySubscript",
"Assign",
"Branch",
"CapturedBlockVariable",
"UndefReturn"
}
}
}
},
{
"cplusplus.",
{
"InnerPointer",
"NewDelete",
"NewDeleteLeaks",
"SelfAssignment"
}
},
"deadcode.DeadStores",
"llvm.Conventions",
{
"nullability.",
{
"NullPassedToNonnull",
"NullReturnedFromNonnull",
"NullableDereferenced",
"NullablePassedToNonnull",
"NullableReturnedFromNonnull"
}
},
{
"optin.",
{
"cplusplus.VirtualCall",
"mpi.MPI-Checker",
{
"osx.",
{
{
"cocoa.",
{
{
"localizability.",
{
"EmptyLocalizationContextChecker",
"NonLocalizedStringChecker"
}
}
}
}
}
},
{
"performance.",
{
"GCDAntipattern",
"Padding"
}
},
"portability.UnixAPI"
}
},
{
"osx.",
{
"API",
"NumberObjectConversion",
"ObjCProperty",
"SecKeychainAPI",
{
"cocoa.",
{
"AtSync",
"AutoreleaseWrite",
"ClassRelease",
"Dealloc",
"IncompatibleMethodTypes",
"Loops",
"MissingSuperCall",
"NSAutoreleasePool",
"NSError",
"NilArg",
"NonNilReturnValue",
"ObjCGenerics",
"RetainCount",
"RunLoopAutoreleaseLeak",
"SelfInit",
"SuperDealloc",
"UnusedIvars",
"VariadicMethodTypes"
}
},
{
"coreFoundation.",
{
"CFError",
"CFNumber",
"CFRetainRelease",
{
"containers.",
{
"OutOfBounds",
"PointerSizedValues"
}
}
}
}
}
},
{
"security.",
{
"FloatLoopCounter",
{
"insecureAPI.",
{
"UncheckedReturn",
"bcmp",
"bcopy",
"bzero",
"getpw",
"gets",
"mkstemp",
"mktemp",
"rand",
"strcpy",
"vfork"
}
}
}
},
{
"unix.",
{
"API",
"Malloc",
"MallocSizeof",
"MismatchedDeallocator",
"StdCLibraryFunctions",
"Vfork",
{
"cstring.",
{
"BadSizeArg",
"NullArg"
}
}
}
},
{
"valist.",
{
"CopyToSelf",
"Uninitialized",
"Unterminated"
}
}
}
},
{
"cppcoreguidelines-",
{
"avoid-goto",
"c-copy-assignment-signature",
"interfaces-global-init",
"narrowing-conversions",
"no-malloc",
"owning-memory",
{
"pro-",
{
{
"bounds-",
{
"array-to-pointer-decay",
"constant-array-index",
"pointer-arithmetic"
}
},
{
"type-",
{
"const-cast",
"cstyle-cast",
"member-init",
"reinterpret-cast",
"static-cast-downcast",
"union-access",
"vararg"
}
}
}
},
"slicing",
"special-member-functions"
}
},
{
"fuchsia-",
{
"default-arguments",
"header-anon-namespaces",
"multiple-inheritance",
"overloaded-operator",
"restrict-system-includes",
"statically-constructed-objects",
"trailing-return",
"virtual-inheritance"
}
},
{
"google-",
{
{
"build-",
{
"explicit-make-pair",
"namespaces",
"using-namespace"
}
},
"default-arguments",
"explicit-constructor",
"global-names-in-headers",
{
"objc-",
{
"avoid-throwing-exception",
"global-variable-declaration"
}
},
{
"readability-",
{
"braces-around-statements",
"casting",
"function-size",
"namespace-comments",
"todo"
}
},
{
"runtime-",
{
"int",
"operator",
"references"
}
}
}
},
{
"hicpp-",
{
"avoid-goto",
"braces-around-statements",
"deprecated-headers",
"exception-baseclass",
"explicit-conversions",
"function-size",
"invalid-access-moved",
"member-init",
"move-const-arg",
"multiway-paths-covered",
"named-parameter",
"new-delete-operators",
{
"no-",
{
"array-decay",
"assembler",
"malloc"
}
},
"noexcept-move",
"signed-bitwise",
"special-member-functions",
"static-assert",
"undelegated-constructor",
{
"use-",
{
"auto",
"emplace",
{
"equals-",
{
"default",
"delete"
}
},
"noexcept",
"nullptr",
"override"
}
},
"vararg"
}
},
{
"llvm-",
{
"header-guard",
"include-order",
"namespace-comment",
"twine-local"
}
},
{
"misc-",
{
"definitions-in-headers",
"misplaced-const",
"new-delete-overloads",
"non-copyable-objects",
"redundant-expression",
"static-assert",
"throw-by-value-catch-by-reference",
"unconventional-assign-operator",
"uniqueptr-reset-release",
{
"unused-",
{
"alias-decls",
"parameters",
"using-decls"
}
}
}
},
{
"modernize-",
{
"avoid-bind",
"deprecated-headers",
"loop-convert",
{
"make-",
{
"shared",
"unique"
}
},
"pass-by-value",
"raw-string-literal",
"redundant-void-arg",
{
"replace-",
{
"auto-ptr",
"random-shuffle"
}
},
"return-braced-init-list",
"shrink-to-fit",
"unary-static-assert",
{
"use-",
{
"auto",
"bool-literals",
"default-member-init",
"emplace",
{
"equals-",
{
"default",
"delete"
}
},
"noexcept",
"nullptr",
"override",
"transparent-functors",
"uncaught-exceptions",
"using"
}
}
}
},
{
"mpi-",
{
"buffer-deref",
"type-mismatch"
}
},
{
"objc-",
{
{
"avoid-",
{
"nserror-init",
"spinlock"
}
},
"forbidden-subclassing",
"property-declaration"
}
},
{
"performance-",
{
"faster-string-find",
"for-range-copy",
"implicit-conversion-in-loop",
{
"inefficient-",
{
"algorithm",
"string-concatenation",
"vector-operation"
}
},
{
"move-",
{
"const-arg",
"constructor-init"
}
},
"noexcept-move-constructor",
"type-promotion-in-math-fn",
{
"unnecessary-",
{
"copy-initialization",
"value-param"
}
},
"simd-intrinsics"
}
},
{
"readability-",
{
"avoid-const-params-in-decls",
"braces-around-statements",
"container-size-empty",
"delete-null-pointer",
"deleted-default",
"else-after-return",
"function-size",
"identifier-naming",
"implicit-bool-conversion",
"inconsistent-declaration-parameter-name",
"misleading-indentation",
"misplaced-array-index",
"named-parameter",
"non-const-parameter",
{
"redundant-",
{
"control-flow",
"declaration",
"function-ptr-dereference",
"member-init",
"smartptr-get",
{
"string-",
{
"cstr",
"init"
}
}
}
},
{
"simplify-",
{
"boolean-expr",
"subscript-expr"
}
},
{
"static-",
{
"accessed-through-instance",
"definition-in-anonymous-namespace"
}
},
"string-compare",
"uniqueptr-delete-release",
"rary-objects"
}
}
}
};
} // namespace Constants
} // namespace CppTools