The current build is relying on the clang-tidy-diff.py script to detect
issues from the current revision diff. This has the advantage to run
fast, since the check is only applied to the changed files and lines,
but it can fail [
https://build.bitcoinabc.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=62036&guest=1#footer
](under some circumstances).
Due to the limited information from the diff, clang-tidy has to guess
the files language, which it does primarly by looking at the extension.
This method can fail for header files with a .h extension: if there is
not enough context to determine if the file is a C or C++ header
clang-tidy will default to C which is likely to fail on our codebase: in
the example above a C++ header (mutex) is included but this header
doesn't exist in C, and clang-tidy fails.
This diff removes this class of errors by running clang-tidy as part of
the cmake build. It achieves the same goal at the expense of an
increased run time on CI.