HomePhabricator

[CI] Update the clang-tidy build

Description

[CI] Update the clang-tidy build

Summary:
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.

Depends on D7536, D7537, D7538.

Test Plan:

./contrib/teamcity/build-configurations.py build-clang-tidy

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D7539

Details

Provenance
FabienAuthored on Sep 23 2020, 11:46
FabienPushed on Sep 23 2020, 14:18
Reviewer
Restricted Project
Differential Revision
D7539: [CI] Update the clang-tidy build
Parents
rABC63563635ea60: [CMAKE] Make clang-tidy fail the build rather than trying to auto-fix
Branches
Unknown
Tags
Unknown