[PATCH] D76606: [clang-tidy] Warn on invalid "case" configurations for readability-identifier-naming

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 23 06:31:06 PDT 2020


njames93 marked 2 inline comments as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:154
+      llvm::errs() << "warning: Invalid case style '" << CaseValue
+                   << "' for readability-identifier-naming." << CaseOptionName;
+      constexpr StringRef AcceptibleNames[] = {
----------------
Unsure about hardcoding the check-name as it could be ran under an alias. However there is no way for a ClangTidyCheck to get the name its ran as. `ClangTidyCheck::CheckName` is `private`, maybe a protected getter would be wise.


================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:177
+      if (EditDistance < 3)
+        llvm::errs() << ": did you mean '" << Closest << "'\n";
+      else
----------------
I feel its safer not assuming the fix and instead letting the user modify their configuration, WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76606





More information about the cfe-commits mailing list