[PATCH] D90282: [clang-tidy] Add IgnoreShortNames config to identifier naming checks

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 09:50:22 PST 2020


njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:127-128
 getFileStyleFromOptions(const ClangTidyCheck::OptionsView &Options) {
   SmallVector<llvm::Optional<IdentifierNamingCheck::NamingStyle>, 0> Styles(
       SK_Count);
   SmallString<64> StyleString;
----------------
Making this change removes the need to NamingStyle to be copy constructable/assignable.


================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h:61
+                          ? llvm::Regex()
+                          : llvm::Regex("^" + IgnoredRegexpStr + "$");
+    }
----------------
Potentially save an allocation.

Also is it wise to warn a user on an invalid regex, unfortunately clang-tidy doesnt support diags with no source location but could still output to llvm::errs.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90282/new/

https://reviews.llvm.org/D90282



More information about the cfe-commits mailing list