carlosgalvezp added inline comments.

================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/readability/strlen-string-cstr.cpp:1
+// RUN: %check_clang_tidy -check-suffix=0 %s readability-strlen-string-cstr %t 
 -- -config="{CheckOptions: [{key: 
readability-strlen-string-cstr.EnableForDataMethod, value: false}]}"
+// RUN: %check_clang_tidy -check-suffix=1 %s readability-strlen-string-cstr %t 
 -- -config="{CheckOptions: [{key: 
readability-strlen-string-cstr.EnableForDataMethod, value: true}]}"
----------------
The default case typically doesn't need a suffix.


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/readability/strlen-string-cstr.cpp:2
+// RUN: %check_clang_tidy -check-suffix=0 %s readability-strlen-string-cstr %t 
 -- -config="{CheckOptions: [{key: 
readability-strlen-string-cstr.EnableForDataMethod, value: false}]}"
+// RUN: %check_clang_tidy -check-suffix=1 %s readability-strlen-string-cstr %t 
 -- -config="{CheckOptions: [{key: 
readability-strlen-string-cstr.EnableForDataMethod, value: true}]}"
+int strlen(const char *);
----------------
Please give a more descriptive name


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/readability/strlen-string-cstr.cpp:35
+  int length = strlen(str1.c_str());
+  // CHECK-MESSAGES-0: [[@LINE-1]]:16: warning: redundant call to 'strlen' 
{{.*}}
+  // CHECK-FIXES-0: {{^  }}int length = str1.size();{{$}}
----------------
Tip: you don't need to write duplicate checks, you can simply skip the suffix 
and it will apply to both RUN lines:

// CHECK-MESSAGES:  ...
// CHECK-FIXES: ...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140968/new/

https://reviews.llvm.org/D140968

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to