HomePhabricator

Revise the google-objc-global-variable-declaration check to match the style…

Description

Revise the google-objc-global-variable-declaration check to match the style guide.

Summary:
Revise the google-objc-global-variable-declaration check to match the style guide.

This commit updates the check as follows:
(1) Do not emit fixes for extern global constants.
(2) Allow the second character of prefixes for constants to be numeric (the new guideline is that global constants should generally be named with a prefix that begins with a capital letter followed by one or more capital letters or numbers).

https://google.github.io/styleguide/objcguide.html#prefixes

Contributed by yaqiji.

Reviewers: Wizard, benhamilton, stephanemoore

Reviewed By: benhamilton, stephanemoore

Subscribers: mgorny, cfe-commits, yaqiji

Tags: #clang

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

Event Timeline

anil9 added a subscriber: anil9.May 28 2019, 8:04 PM

Hello,

I think your changeset caused a failure in this buildbot.
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/18933
Failure : http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/18933/steps/ninja%20check%201/logs/stdio

FAIL: Clang Tools :: clang-tidy/google-objc-global-variable-declaration.m (16425 of 50949)

  • TEST 'Clang Tools :: clang-tidy/google-objc-global-variable-declaration.m' FAILED ****

Script:

: 'RUN: at line 1'; /usr/bin/python2.7 /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/tools/clang/tools/extra/test/../test/clang-tidy/check_clang_tidy.py /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/tools/clang/tools/extra/test/clang-tidy/google-objc-global-variable-declaration.m google-objc-global-variable-declaration /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/Output/google-objc-global-variable-declaration.m.tmp

Exit Code: 1

Command Output (stdout):

Running ['clang-tidy', '/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/Output/google-objc-global-variable-declaration.m.tmp.m', '-fix', '--checks=-*,google-objc-global-variable-declaration', '-format-style=none', '--', '-fobjc-abi-version=2', '-fobjc-arc', '-nostdinc++']...

  • clang-tidy output -----------------------