[PATCH] D75184: [clang-tidy] Optional inheritance of file configs from parent directories
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 10 08:40:02 PDT 2020
njames93 added a comment.
In D75184#1914705 <https://reviews.llvm.org/D75184#1914705>, @DmitryPolukhin wrote:
> You are absolutely right about current behaviour. Thank you for catching this odd behaviour. I'm not 100% confident what is the right behaviour but my guess is that overriding local option from parent config with global from child folder is better so I implemented it and added corresponding test.
It's a tricky one that, but I thing overriding the local option with the global in the sub directory is the correct way to go about this as well.
================
Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:144
+ // Assume that global options don't have dot in the name.
+ return Name.find('.') == std::string::npos;
+}
----------------
May I suggest using `return !Name.contains('.');` to make the code more readable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75184/new/
https://reviews.llvm.org/D75184
More information about the cfe-commits
mailing list