Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-06-05 12:37:49 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-07-03 10:57:41 +0300
commit9ea5469178a9a4ab5d4048f7aaf18af85a8265a3 (patch)
treea211d638b85ef0871d3fe7311cb3d3eeb6f2c96d /.clang-tidy
parenta272a2a6cdc30c30d3957787f30211cfc5b9d35c (diff)
Initial support of clang-tidy toolchain
Clang Tidy is a Clang based "linter" tool which goal is to help fixing typical programming errors. It is run as a separate compile step of every file, which slows compilation down but allows to fully analyze the file the same way as compiler does and catch non-trivial bugprone cases. This change includes: - CMake option called `WITH_CLANG_TIDY` which enables Clang Tidy linter tool on all source in the `source/` directory. This option is only available on Linux, as it is currently the easiest platform to get the Clang Tidy toolchain to work. - CMake module which is aimed to find latest available Clang Tidy. - Set of rules which allows to have Blender fully compiled without extra issues. The goal of this change is to provide a base ground so that solving all the warnings can happen later on, as a team effort. It should be possible to use Clang Tidy side-by-side with both GCC and Clang, but there seems to be some tweaks to be done in CMake to make it really work for Blender. For now use Clang toolchain if there are issues with GCC+Clang Tidy. It will be worked on in the nearest future to bring seamless experience for all configurations. Currently there is no official way of getting Clang Tidy on macOS, and on Windows there are some difficulties of hooking up Clang Tidy from LLVM package to the MSVC compiler toolchain. The actual warnings in the code will be addressed as a part of the Code Quality Days, task T78535. Differential Revision: https://developer.blender.org/D7937
Diffstat (limited to '.clang-tidy')
-rw-r--r--.clang-tidy54
1 files changed, 54 insertions, 0 deletions
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 00000000000..7017ce9e97d
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,54 @@
+Checks: >
+ -*,
+ readability-*,
+ -readability-uppercase-literal-suffix,
+ -readability-magic-numbers,
+ -readability-isolate-declaration,
+ -readability-convert-member-functions-to-static,
+ -readability-implicit-bool-conversion,
+ -readability-avoid-const-params-in-decls,
+ -readability-simplify-boolean-expr,
+ -readability-make-member-function-const,
+
+ -readability-misleading-indentation,
+
+ -readability-else-after-return,
+ -readability-braces-around-statements,
+ -readability-inconsistent-declaration-parameter-name,
+ -readability-non-const-parameter,
+ -readability-redundant-preprocessor,
+ -readability-redundant-control-flow,
+ -readability-named-parameter,
+ -readability-function-size,
+ -readability-function-size,
+ -readability-static-definition-in-anonymous-namespace,
+ -readability-delete-null-pointer,
+ -readability-redundant-string-init,
+ -readability-redundant-member-init,
+ -readability-const-return-type,
+ -readability-container-size-empty,
+ -readability-redundant-string-cstr,
+ -readability-static-accessed-through-instance,
+ -readability-redundant-declaration,
+
+ bugprone-*,
+ -bugprone-narrowing-conversions,
+ -bugprone-unhandled-self-assignment,
+ -bugprone-branch-clone,
+ -bugprone-macro-parentheses,
+
+ -bugprone-sizeof-expression,
+ -bugprone-integer-division,
+ -bugprone-incorrect-roundings,
+ -bugprone-suspicious-string-compare,
+ -bugprone-too-small-loop-variable,
+ -bugprone-misplaced-widening-cast,
+ -bugprone-not-null-terminated-result,
+ -bugprone-suspicious-missing-comma,
+ -bugprone-argument-comment,
+ -bugprone-assert-side-effect,
+ -bugprone-parent-virtual-call,
+ -bugprone-infinite-loop,
+ -bugprone-copy-constructor-init,
+
+WarningsAsErrors: '*'