[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.
Stephane Moore via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 29 20:45:08 PDT 2019
stephanemoore accepted this revision.
stephanemoore marked an inline comment as done.
stephanemoore added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m:46
+// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: non-const global variable 'Y2Bad' must have a name which starts with 'g[A-Z]' [google-objc-global-variable-declaration]
+// CHECK-FIXES: extern NSString* gY2Bad;
+
----------------
This is interesting as it respects the Google Objective-C Style Guide as it is currently written. I think the truth might actually be that there are no guidelines for non-const extern variables as they are incredibly rare and presumably ubiquitously discouraged. In that respect, I am not sure that the fix here represents what would actually be recommended for Google Objective-C. With that said, the fix might be reasonable to emit based on the expectation that it would be exceedingly rare and it's unclear what better guidance we would provide. I think it's fine to continue allowing this existing behavior and continue monitoring.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62045/new/
https://reviews.llvm.org/D62045
More information about the cfe-commits
mailing list