[PATCH] D16113: [clang-tdiy] Add header file extension configuration support.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 14 17:19:50 PST 2016


hokein marked 11 inline comments as done.

================
Comment at: clang-tidy/ClangTidy.h:65
@@ -56,3 +64,3 @@
   /// \c CheckOptions. If the corresponding key is not present, returns
   /// \p Default.
   template <typename T>
----------------
Makes sense. I just refer from `std::string get(StringRef LocalName, std::string Default) const`. Also change `get` to use `StringRef`.

================
Comment at: clang-tidy/tool/ClangTidyMain.cpp:78
@@ +77,3 @@
+static cl::opt<std::string>
+HeaderFileExtensions("header-file-extensions",
+                     cl::desc("File extensions that regard as header file.\n"
----------------
aaron.ballman wrote:
> alexfh wrote:
> > hokein wrote:
> > > alexfh wrote:
> > > > We don't need a command-line flag for this. The regular way to configure clang-tidy is .clang-tidy files. However, if needed, check options can be configured from the command line via the `-config=` option. 
> > > From my understanding, it is a global option for header-file-extensions, right? If we remove this command-line flag, there is only local `header-file-extensions` option remained for particular checks.
> > Both local and global options reside in `CheckOptions` and can be configured in the same way using either a .clang-tidy file or the -config= command-line option. The only difference between local and global options is that the name of the latter is not prefixed with the "CheckName.". Makes sense?
> > Both local and global options reside in CheckOptions and can be configured in the same way using either a .clang-tidy file or the -config= command-line option. The only difference between local and global options is that the name of the latter is not prefixed with the "CheckName.". Makes sense?
> 
> Ah, thank you for that explanation. I learned something new today. ;-)
I see it.


http://reviews.llvm.org/D16113





More information about the cfe-commits mailing list