[PATCH] D75184: [clang-tidy] Optional inheritance of file configs from parent directories 

Dmitry Polukhin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 08:00:09 PDT 2020


DmitryPolukhin added a comment.

@alexfh thank you for review!



================
Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.h:101-104
+    ClangTidyValue(const char *Value) : Value(Value), Priority(0) {}
+    ClangTidyValue(const std::string &Value) : Value(Value), Priority(0) {}
+    ClangTidyValue(const std::string &Value, unsigned Priority)
+        : Value(Value), Priority(Priority) {}
----------------
alexfh wrote:
> Maybe just `ClangTidyValue(StringRef Value, unsigned Priority = 0)`?
Reduced number of c-tors to 2 with default value. We need `ClangTidyValue(const char *Value)` for supporting lots of constructs like `Opts["cert-dcl16-c.NewSuffixes"] = "L;LL;LU;LLU";` without changing lots of code without good reason.


================
Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:41
+  in the parent directory (if any exists) will be taken and current config file
+  will be applied on top of the parent one. If any configuration options have
+  a corresponding command-line option, command-line option takes precedence.
----------------
alexfh wrote:
> Does the new logic related to local and global options deserve a separate mention here?
I think adding global vs local here will only add more confusion and general statement about precedence still true. As far as I can see there are no оreferences to global options in user documentation. 


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