Page MenuHomePhabricator

[CI] Update the clang-tidy build
ClosedPublic

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

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC7626847ab713: [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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable