llvm-project/clang-tools-extra/clang-tidy/google
Ben Hamilton 490811ec3f [clang-tidy] Function-scoped static variables should not trigger google-objc-global-variable-declaration
Summary:
google-objc-global-variable-declaration currently triggers on
valid code like:

  - (void)foo {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{ /* ... */ });
  }

The Google Objective-C style guide says:

http://google.github.io/styleguide/objcguide.html#common-variable-names

> File scope or global variables (as opposed to constants) declared
> outside the scope of a method or function should be rare, and should
> have the prefix g.

which is meant to insinuate that static variables inside a method or
function don't need a special name.

Test Plan: `make -j12 check-clang-tools`

Reviewers: Wizard, hokein, klimek

Reviewed By: Wizard

Subscribers: xazax.hun, cfe-commits

Differential Revision: https://reviews.llvm.org/D41789

llvm-svn: 321914
2018-01-05 23:26:06 +00:00
..
AvoidCStyleCastsCheck.cpp [clang-tidy] Ignore blank spaces between cast's ")" and its sub expr. 2017-07-12 16:38:59 +00:00
AvoidCStyleCastsCheck.h [clang-tidy] update links to Google Code Style in docs 2016-02-25 14:31:10 +00:00
AvoidThrowingObjCExceptionCheck.cpp add check to avoid throwing objc exception according to Google Objective-C guide 2017-11-16 01:28:29 +00:00
AvoidThrowingObjCExceptionCheck.h add check to avoid throwing objc exception according to Google Objective-C guide 2017-11-16 01:28:29 +00:00
CMakeLists.txt add check to avoid throwing objc exception according to Google Objective-C guide 2017-11-16 01:28:29 +00:00
DefaultArgumentsCheck.cpp [clang-tidy] new google-default-arguments check 2016-05-09 13:43:58 +00:00
DefaultArgumentsCheck.h [clang-tidy] new google-default-arguments check 2016-05-09 13:43:58 +00:00
ExplicitConstructorCheck.cpp [clang-tidy] Fix google-explicit-constructor issue with out-of-line conversions 2017-04-18 17:26:00 +00:00
ExplicitConstructorCheck.h [clang-tidy] update links to Google Code Style in docs 2016-02-25 14:31:10 +00:00
ExplicitMakePairCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
ExplicitMakePairCheck.h
GlobalNamesInHeadersCheck.cpp [clang-tidy] Unify the way IncludeStyle and HeaderFileExtesions options are used 2017-07-20 12:02:03 +00:00
GlobalNamesInHeadersCheck.h [clang-tidy] Fix/add style guide links. 2016-05-19 09:31:30 +00:00
GlobalVariableDeclarationCheck.cpp [clang-tidy] Function-scoped static variables should not trigger google-objc-global-variable-declaration 2018-01-05 23:26:06 +00:00
GlobalVariableDeclarationCheck.h Add new check in google module for Objective-C code to ensure global variables follow the naming convention of Google Objective-C Style Guide 2017-11-07 08:53:37 +00:00
GoogleTidyModule.cpp add check to avoid throwing objc exception according to Google Objective-C guide 2017-11-16 01:28:29 +00:00
IntegerTypesCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
IntegerTypesCheck.h [clang-tidy] google-runtime-int: fix a false positive in implicit code. 2016-02-11 16:22:58 +00:00
NonConstReferences.cpp modernize-use-auto NFC fixes 2016-12-14 15:29:23 +00:00
NonConstReferences.h [clang-tidy] Add a whitelist option in google-runtime-references. 2016-10-10 16:38:11 +00:00
OverloadedUnaryAndCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
OverloadedUnaryAndCheck.h [clang-tidy] update links to Google Code Style in docs 2016-02-25 14:31:10 +00:00
StringReferenceMemberCheck.cpp Adapt clang-tidy checks to changing semantics of hasDeclaration. 2017-08-02 13:13:11 +00:00
StringReferenceMemberCheck.h
TodoCommentCheck.cpp
TodoCommentCheck.h
UnnamedNamespaceInHeaderCheck.cpp [clang-tidy] Unify the way IncludeStyle and HeaderFileExtesions options are used 2017-07-20 12:02:03 +00:00
UnnamedNamespaceInHeaderCheck.h [clang-tidy] update links to Google Code Style in docs 2016-02-25 14:31:10 +00:00
UsingNamespaceDirectiveCheck.cpp Make google-build-using-namespace skip std::.*literals 2017-05-15 17:37:48 +00:00
UsingNamespaceDirectiveCheck.h Make google-build-using-namespace skip std::.*literals 2017-05-15 17:37:48 +00:00