[cmake-developers] Integration of clang-tidy
Daniel Pfeifer
daniel at pfeifer-mail.de
Fri Apr 8 18:31:59 EDT 2016
Hi,
I implemented the integration of `clang-tidy` along the lines of the
`include-what-you-use` integration.
There is a new `<LANG>_CLANG_TIDY` target property that is initialized
with the value of the `CMAKE_<LANG>_CLANG_TIDY` variable.
It contains the command line for `clang-tidy` as a ;-list.
Example use:
$ cmake -DCMAKE_CXX_CLANG_TIDY:STRING="clang-tidy;-checks=-*,readability-*" ..
$ cmake --build .
It is also possible to let `clang-tidy` apply fixit hints directly:
$ cmake -DCMAKE_CXX_CLANG_TIDY:STRING="clang-tidy;-checks=-*,readability-redundant-string-cstr;-fix"
..
The output is recognized by CTest's diagnostic parser. I haven't
checked how they look on CDash.
cheers, Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Provide-integration-for-clang-tidy.patch
Type: text/x-patch
Size: 18901 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160409/64c2c601/attachment-0001.bin>
More information about the cmake-developers
mailing list