[PATCH] D45392: [clang-tidy] add new check to find out objc ivars which do not have prefix '_'

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 12 04:09:20 PDT 2018


alexfh added inline comments.


================
Comment at: test/clang-tidy/readability-identifier-naming-objc.m:8-9
+// RUN:   ]}' -- -fno-delayed-template-parsing \
+// RUN:   -I%S/Inputs/readability-identifier-naming \
+// RUN:   -isystem %S/Inputs/readability-identifier-naming/system
+
----------------
Wizard wrote:
> alexfh wrote:
> > It looks like these flags are not needed, since there are no #include directives in this test.
> So we won't worry about those flags when using this check in google codebase right?
These flags are used by the other test to specify directories used  to search for #included headers. Since the test is copied to a temporary directory by the check_clang_tidy.py script and the headers stay in the source tree (see the test/clang-tidy/Inputs/readability-identifier-naming/ directory), the test can't just use relative include paths, instead we specify the full path using the -I and -isystem compiler options. In real use cases all compilation arguments (including the required `-I` and `-isystem` options) are taken from a compilation database.  No need to specify them in clang-tidy configuration.


================
Comment at: test/clang-tidy/readability-identifier-naming-objc.m:4
+// RUN:  [{key: readability-identifier-naming.ObjcIvarPrefix, value: '_'}]}' \
+// RUN: --
+
----------------
The `--` and the trailing backslash above can be removed as well.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45392





More information about the cfe-commits mailing list