clang-tidy reporting unknown warnings
For me,
set(CMAKE_CXX_CLANG_TIDY "clang-tidy-8;--extra-arg=-Wno-error=unknown-warning-option")
solved the issue when running clang-tidy from within CMake.
Try appending -extra-arg=-Wno-unknown-warning-option
to clang-tidy command line.
Using -extra-arg=
asks clang-tidy to pass -Wno-unknown-warning-option
to the underlying clang. Otherwise, it tries to interpret it as a clang-tidy flag.
Edit:
The run-clang-tidy.py
script supports -extra-arg
starting version 5.0. In prior versions, you'd need to edit the script and add that -extra-arg
manually.
If you're on Ubuntu 16.04, you can get clang-tidy-5.0
from:
https://www.ubuntuupdates.org/package/xorg-edgers/xenial/main/base/clang-tidy-5.0