Page MenuHomePhabricator

[CI] Update the clang-tidy build

Authored by Fabien on Wed, Sep 23, 11:59.


Group Reviewers
Restricted Project
rABC7626847ab713: [CI] Update the clang-tidy build

The current build is relying on the 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 [
](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.

Depends on D7536, D7537, D7538.

Test Plan
./contrib/teamcity/ build-clang-tidy

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.