[clang-tidy] Optional inheritance of file configs from parent directories 
authorDmitry Polukhin <dmitry.polukhin@gmail.com>
Wed, 1 Apr 2020 09:08:53 +0000 (02:08 -0700)
committerDmitry Polukhin <dmitry.polukhin@gmail.com>
Wed, 15 Apr 2020 13:41:31 +0000 (06:41 -0700)
commitcb1ee34e9d32fce84613827693a8ed3aff1d36cf
treeeac0d459528c054e2ed0c37252b447a8bd46b16d
parentd85b3877dcd283feb6075162765664173cf1488f
[clang-tidy] Optional inheritance of file configs from parent directories 

Summary:
Without this patch clang-tidy stops finding file configs on the nearest
.clang-tidy file. In some cases it is not very convenient because it
results in common parts duplication into every child .clang-tidy file.
This diff adds optional config inheritance from the parent directories
config files.

Test Plan:

Added test cases in existing config test.

Reviewers: alexfh, gribozavr2, klimek, hokein

Subscribers: njames93, arphaman, xazax.hun, aheejin, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D75184
12 files changed:
clang-tools-extra/clang-tidy/ClangTidy.cpp
clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
clang-tools-extra/clang-tidy/ClangTidyOptions.h
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/3/.clang-tidy [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/4/.clang-tidy [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/4/44/.clang-tidy [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp
clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp