[clang-tools-extra] [NFC][clang-tidy] Remove {{^}} clauses in some tests (3/N) (PR #135826)
https://github.com/nicovank closed https://github.com/llvm/llvm-project/pull/135826 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [NFC][clang-tidy] Remove {{^}} clauses in some tests (3/N) (PR #135826)
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/135826 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [NFC][clang-tidy] Remove {{^}} clauses in some tests (3/N) (PR #135826)
llvmbot wrote:
@llvm/pr-subscribers-clang-tools-extra
Author: Nicolas van Kempen (nicovank)
Changes
`check_clang_tidy` now matches full lines only, so `{{^}}` clauses are no
longer necessary.
I am splitting those changes over multiple PRs to make review easier. Numbering
them but the actual order doesn't matter.
---
Patch is 35.30 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/135826.diff
10 Files Affected:
- (modified)
clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
(+16-16)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier-c.c
(+1-1)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier.cpp
(+36-36)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.cpp
(+12-12)
- (modified) clang-tools-extra/test/clang-tidy/checkers/llvm/qualified-auto.cpp
(+2-2)
- (modified) clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.cpp
(+34-34)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-macros.cpp
(+5-5)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/modernize/unary-static-assert.cpp
(+3-3)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/modernize/use-bool-literals-ignore-macros.cpp
(+27-27)
- (modified)
clang-tools-extra/test/clang-tidy/checkers/modernize/use-override-cxx98.cpp
(+3-3)
``diff
diff --git
a/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
b/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
index aabb30fe34f78..c2ce0e347e074 100644
---
a/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
+++
b/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
@@ -29,67 +29,67 @@ std::string bar();
void tests(std::string s, global_string s2, std::string_view sv) {
s.find("a") == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith instead of
find() == 0 [abseil-string-find-startswith]
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, "a");
s.find(s) == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, s);{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, s);
s.find("aaa") != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "aaa");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "aaa");
s.find(foo(foo(bar( != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, foo(foo(bar(;{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, foo(foo(bar(;
if (s.find("") == 0) { /* do something */ }
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}if (absl::StartsWith(s, "")) { /* do
something */ }{{$}}
+ // CHECK-FIXES: if (absl::StartsWith(s, "")) { /* do something */ }
0 != s.find("a");
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "a");
s2.find("a") == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s2, "a");{{$}}
+ // CHECK-FIXES: absl::StartsWith(s2, "a");
s.rfind("a", 0) == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith instead of
rfind() == 0 [abseil-string-find-startswith]
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, "a");
s.rfind(s, 0) == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, s);{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, s);
s.rfind("aaa", 0) != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "aaa");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "aaa");
s.rfind(foo(foo(bar())), 0) != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, foo(foo(bar(;{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, foo(foo(bar(;
if (s.rfind("", 0) == 0) { /* do something */ }
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}if (absl::StartsWith(s, "")) { /* do
something */ }{{$}}
+ // CHECK-FIXES: if (absl::StartsWith(s, "")) { /* do something */ }
0 != s.rfind("a", 0);
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: !absl
[clang-tools-extra] [NFC][clang-tidy] Remove {{^}} clauses in some tests (3/N) (PR #135826)
https://github.com/nicovank created
https://github.com/llvm/llvm-project/pull/135826
`check_clang_tidy` now matches full lines only, so `{{^}}` clauses are no
longer necessary.
I am splitting those changes over multiple PRs to make review easier. Numbering
them but the actual order doesn't matter.
>From 998d2f7130ee86a5df5acf364259c3f87e9ae94e Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Tue, 15 Apr 2025 13:47:33 -0400
Subject: [PATCH] [NFC][clang-tidy] Remove {{^}} clauses in some tests (3/N)
`check_clang_tidy` now matches full lines only, so `{{^}}` clauses are no
longer necessary.
I am splitting those changes over multiple PRs to make review easier. Numbering
them but the actual order doesn't matter.
---
.../abseil/string-find-startswith.cpp | 32 -
.../checkers/bugprone/reserved-identifier-c.c | 2 +-
.../checkers/bugprone/reserved-identifier.cpp | 72 +--
.../checkers/google/readability-casting.cpp | 24 +++
.../checkers/llvm/qualified-auto.cpp | 4 +-
.../checkers/misc/static-assert.cpp | 68 +-
.../checkers/modernize/make-unique-macros.cpp | 10 +--
.../modernize/unary-static-assert.cpp | 6 +-
.../use-bool-literals-ignore-macros.cpp | 54 +++---
.../checkers/modernize/use-override-cxx98.cpp | 6 +-
10 files changed, 139 insertions(+), 139 deletions(-)
diff --git
a/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
b/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
index aabb30fe34f78..c2ce0e347e074 100644
---
a/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
+++
b/clang-tools-extra/test/clang-tidy/checkers/abseil/string-find-startswith.cpp
@@ -29,67 +29,67 @@ std::string bar();
void tests(std::string s, global_string s2, std::string_view sv) {
s.find("a") == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith instead of
find() == 0 [abseil-string-find-startswith]
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, "a");
s.find(s) == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, s);{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, s);
s.find("aaa") != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "aaa");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "aaa");
s.find(foo(foo(bar( != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, foo(foo(bar(;{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, foo(foo(bar(;
if (s.find("") == 0) { /* do something */ }
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}if (absl::StartsWith(s, "")) { /* do
something */ }{{$}}
+ // CHECK-FIXES: if (absl::StartsWith(s, "")) { /* do something */ }
0 != s.find("a");
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "a");
s2.find("a") == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s2, "a");{{$}}
+ // CHECK-FIXES: absl::StartsWith(s2, "a");
s.rfind("a", 0) == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith instead of
rfind() == 0 [abseil-string-find-startswith]
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, "a");
s.rfind(s, 0) == 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, s);{{$}}
+ // CHECK-FIXES: absl::StartsWith(s, s);
s.rfind("aaa", 0) != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "aaa");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "aaa");
s.rfind(foo(foo(bar())), 0) != 0;
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, foo(foo(bar(;{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, foo(foo(bar(;
if (s.rfind("", 0) == 0) { /* do something */ }
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}if (absl::StartsWith(s, "")) { /* do
something */ }{{$}}
+ // CHECK-FIXES: if (absl::StartsWith(s, "")) { /* do something */ }
0 != s.rfind("a", 0);
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
- // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "a");{{$}}
+ // CHECK-FIXES: !absl::StartsWith(s, "a");
s2.rfind("a", 0) == 0;
// CHECK-MESSAGES: :[[@LI
