forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the Clang-tidy support (ENABLE_CLANG_TIDY option for CMake). (v…
…esoft-inc#214) * Added the Clang-tidy support (ENABLE_CLANG_TIDY option for CMake). * address laura's comment.
- Loading branch information
Showing
4 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-misc-unused-parameters, | ||
bugprone-argument-comment, | ||
bugprone-assert-side-effect, | ||
bugprone-bad-signal-to-kill-thread, | ||
bugprone-bool-pointer-implicit-conversion, | ||
bugprone-branch-clone, | ||
bugprone-copy-constructor-init, | ||
bugprone-dangling-handle, | ||
bugprone-dynamic-static-initializers, | ||
bugprone-fold-init-type, | ||
bugprone-forward-declaration-namespace, | ||
bugprone-forwarding-reference-overload, | ||
bugprone-inaccurate-erase, | ||
bugprone-incorrect-roundings, | ||
bugprone-infinite-loop, | ||
bugprone-integer-division, | ||
bugprone-lambda-function-name, | ||
bugprone-macro-parentheses, | ||
bugprone-macro-repeated-side-effects, | ||
bugprone-misplaced-operator-in-strlen-in-alloc, | ||
bugprone-misplaced-pointer-arithmetic-in-alloc, | ||
bugprone-misplaced-widening-cast, | ||
bugprone-move-forwarding-reference, | ||
bugprone-multiple-statement-macro, | ||
bugprone-not-null-terminated-result, | ||
bugprone-parent-virtual-call, | ||
bugprone-posix-return, | ||
bugprone-reserved-identifier, | ||
bugprone-signed-char-misuse, | ||
bugprone-sizeof-container, | ||
bugprone-sizeof-expression, | ||
bugprone-spuriously-wake-up-functions, | ||
bugprone-string-constructor, | ||
bugprone-string-integer-assignment, | ||
bugprone-string-literal-with-embedded-nul, | ||
bugprone-suspicious-enum-usage, | ||
bugprone-suspicious-include, | ||
bugprone-suspicious-memset-usage, | ||
bugprone-suspicious-missing-comma, | ||
bugprone-suspicious-semicolon, | ||
bugprone-suspicious-string-compare, | ||
bugprone-swapped-arguments, | ||
bugprone-terminating-continue, | ||
bugprone-throw-keyword-missing, | ||
bugprone-too-small-loop-variable, | ||
bugprone-undefined-memory-manipulation, | ||
bugprone-undelegated-constructor, | ||
bugprone-unhandled-self-assignment, | ||
bugprone-unused-raii, | ||
bugprone-unused-return-value, | ||
bugprone-use-after-move, | ||
google-build-explicit-make-pair, | ||
google-build-namespaces, | ||
google-build-using-namespace, | ||
google-default-arguments, | ||
google-explicit-constructor, | ||
google-global-names-in-headers, | ||
google-objc-avoid-nsobject-new, | ||
google-objc-function-naming, | ||
google-objc-global-variable-declaration, | ||
google-readability-avoid-underscore-in-googletest-name, | ||
google-readability-casting, | ||
google-runtime-int, | ||
google-runtime-operator, | ||
google-upgrade-googletest-case, | ||
modernize-avoid-bind, | ||
modernize-concat-nested-namespaces, | ||
modernize-deprecated-headers, | ||
modernize-deprecated-ios-base-aliases, | ||
modernize-loop-convert, | ||
modernize-make-shared, | ||
modernize-make-unique, | ||
modernize-raw-string-literal, | ||
modernize-redundant-void-arg, | ||
modernize-replace-auto-ptr, | ||
modernize-replace-random-shuffle, | ||
modernize-return-braced-init-list, | ||
modernize-shrink-to-fit, | ||
modernize-unary-static-assert, | ||
modernize-use-bool-literals, | ||
modernize-use-default-member-init, | ||
modernize-use-emplace, | ||
modernize-use-equals-default, | ||
modernize-use-equals-delete, | ||
modernize-use-nodiscard, | ||
modernize-use-nullptr, | ||
modernize-use-override, | ||
modernize-use-trailing-return-type, | ||
modernize-use-transparent-functors, | ||
modernize-use-using, | ||
performance-faster-string-find, | ||
performance-for-range-copy, | ||
performance-implicit-conversion-in-loop, | ||
performance-inefficient-algorithm, | ||
performance-inefficient-string-concatenation, | ||
performance-inefficient-vector-operation, | ||
performance-move-constructor-init, | ||
performance-no-automatic-move, | ||
performance-trivially-destructible, | ||
performance-type-promotion-in-math-fn, | ||
performance-unnecessary-copy-initialization, | ||
' | ||
|
||
HeaderFilterRegex: '/(?!third-party)|(?!interface)/' | ||
AnalyzeTemporaryDtors: false | ||
FormatStyle: 'file' | ||
WarningsAsErrors: '*' | ||
CheckOptions: | ||
- key: cert-dcl16-c.NewSuffixes | ||
value: 'L;LL;LU;LLU' | ||
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic | ||
value: '1' | ||
- key: google-readability-braces-around-statements.ShortStatementLines | ||
value: '1' | ||
- key: google-readability-function-size.StatementThreshold | ||
value: '800' | ||
- key: google-readability-namespace-comments.ShortNamespaceLines | ||
value: '10' | ||
- key: google-readability-namespace-comments.SpacesBeforeComments | ||
value: '2' | ||
- key: modernize-loop-convert.MaxCopySize | ||
value: '16' | ||
- key: modernize-loop-convert.MinConfidence | ||
value: reasonable | ||
- key: modernize-loop-convert.NamingStyle | ||
value: CamelCase | ||
- key: modernize-pass-by-value.IncludeStyle | ||
value: llvm | ||
- key: modernize-replace-auto-ptr.IncludeStyle | ||
value: llvm | ||
- key: modernize-use-nullptr.NullMacros | ||
value: 'NULL' | ||
- key: readability-identifier-naming.EnumConstantCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.EnumConstantPrefix | ||
value: k | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if (ENABLE_CLANG_TIDY) | ||
if (${CMAKE_VERSION} VERSION_LESS "3.6.0") | ||
message(FATAL_ERROR "clang-tidy requires CMake version at least 3.6.") | ||
endif() | ||
|
||
find_program (CLANG_TIDY_PATH NAMES "clang-tidy") | ||
if (CLANG_TIDY_PATH) | ||
message(STATUS "Using clang-tidy: ${CLANG_TIDY_PATH}.") | ||
set (CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_PATH} --config=) | ||
else () | ||
message(STATUS "clang-tidy is not found.") | ||
endif () | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters