[PATCH] Extend the check to detect patterns like 'ptr.get() == nullptr'

Samuel Benzaquen sbenza at google.com
Tue Apr 8 08:49:53 PDT 2014



================
Comment at: test/clang-tidy/check_clang_tidy_fix.sh:9
@@ +8,3 @@
+
+grep -v CHECK ${INPUT_FILE} > ${TEMPORARY_FILE} \
+  && clang-tidy ${TEMPORARY_FILE} -fix --checks=${CHECK_TO_RUN} \
----------------
Alexander Kornienko wrote:
> I'd leave the grep as it was in the test, so that it filters out RUN: lines as well, and it only filters out comments:
> 
>   grep -Ev "// *[A-Z-]+:" ...
> 
> We'll have some checks for comments, so filtering out special comments can be important there.
Done.

================
Comment at: test/clang-tidy/check_clang_tidy_output.sh:8
@@ +7,3 @@
+
+clang-tidy --checks=${CHECK_TO_RUN} --disable-checks="" ${INPUT_FILE} \
+  -- --std=c++11 | FileCheck ${INPUT_FILE}
----------------
Alexander Kornienko wrote:
> nit: I'd format this still a bit differently (where's my sh-format? ;), four spaces on the continuation line, and each pipe component from a new line with 2 spaces indentation:
> 
>   clang-tidy --checks=${CHECK_TO_RUN} --disable-checks="" ${INPUT_FILE} \
>       -- --std=c++11 \
>     | FileCheck ${INPUT_FILE}
Done.


http://reviews.llvm.org/D3294

BRANCH
  get_==

ARCANIST PROJECT
  clang-tools-extra






More information about the cfe-commits mailing list