Blender Git Commit Log

Git Commits -> Revision 9ea5469

Revision 9ea5469 by Sergey Sharybin (master)
July 3, 2020, 07:57 (GMT)
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

Commit Details:

Full Hash: 9ea5469178a9a4ab5d4048f7aaf18af85a8265a3
Parent Commit: a272a2a
Lines Changed: +173, -0

2 Added Paths:

/.clang-tidy (+54, -0)
/build_files/cmake/Modules/FindClangTidy.cmake (+104, -0) (View)

2 Modified Paths:

/CMakeLists.txt (+5, -0) (Diff)
/source/CMakeLists.txt (+10, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021