This is an archive of the discontinued LLVM Phabricator instance.

Allow passing a regex for headers to exclude from clang-tidy
AbandonedPublic

Authored by toddlipcon on Jun 20 2017, 12:35 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

This patch adds the ability to specify a regex of headers to exclude from clang-tidy diagnostics. This is the inverse of the existing header regex.

In our project we want to do something like include src/.*.h but exclude src/some-thirdparty/.*.h. Given only a positive regex configuration, we would have had to list all directories aside from 'some-thirdparty' such as src/(foo|bar|baz|...)/, which isn't practical or maintainable.

A while back there was a thread http://lists.llvm.org/pipermail/cfe-dev/2015-November/046203.html which suggested using extended regexes which offer negative lookahead assertions to achieve this, but it was rejected due to poor stdlib support. I think an "exclude" regex is also more familiar to users since it shows up commonly in tools like rsync/tar/etc.

Diff Detail

Repository
rL LLVM