[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Addressed feedback. I do not have commit access, can you please merge after CI is green? Assuming GitHub will properly populate information, if not you can use `Nicolas van Kempen `. https://github.com/llvm/llvm-project/pull/72283

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From cf4a78c252c5aac820581b90c28c6581c6e41cfb Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, once you correct latest comments & CI will pass, fell free to merge. https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -28,9 +28,9 @@ Options .. option:: StringLikeClasses - Semicolon-separated list of names of string-like classes. By default only - ``std::basic_string`` is considered. The list of methods to considered is - fixed. + Semicolon-separated list of names of string-like

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -96,6 +83,10 @@ void tests(std::string s, global_string s2) { // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s2, "a");{{$}} + sv.find("a") == 0; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -19,11 +19,14 @@ using namespace clang::ast_matchers; namespace clang::tidy::abseil { +const auto DefaultStringLikeClasses = +"::std::basic_string; ::std::basic_string_view"; PiotrZSL wrote: Remove this space ```suggestion

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > Copy this check. Got it. Thanks for the pointer! > Documentation, string header. I think I covered everything, had to add a couple of skeletons to that `string` common header. https://github.com/llvm/llvm-project/pull/72283 ___

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From 42364ebb6f3e5771947133599a1142522c511337 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From 1761f02f54f125948b10d2321807af2154dbbc3f Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From a7361968b8a1acc48c4ef563c70f5c56f2633eac Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. documentation, string header, release notes https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: As for this check: - use string header - update check documentation (option default and description) - make sure that documentation is in sync with class documentation - add release notes entry about improving check to support std::string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: _"I am slowly looking into adding an option to this check to recommend C++20's API starts_with, and move it to modernize. Possibly would like to use it as a codemod on our code."_ Actually best would be to copy this check to performance-use-starts_with (or modernize) or

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -22,6 +22,21 @@ struct basic_string { typedef basic_string string; typedef basic_string wstring; +template PiotrZSL wrote: Actually string and string_view is defined already in header test/clang-tidy/checkers/Inputs/Headers/string. Just add `--

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: First time with LLVM GitHub PR workflow. Am I supposed to tag potential reviewers? @gribozavr @hokein @njames93 https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Nicolas van Kempen (nicovank) Changes As per title. A small improvement to this check, `string_view` should work out of the box. I am slowly looking into adding an option to this check to recommend C++20's API `starts_with`, and

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank ready_for_review https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From dc890dc762a3400937a6a5d91963dead024c3569 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From 3abdf06b2128fbd6ccc03f804a8d3bdde6d772c9 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 57dd23bc0a2f7b4f7b68162923b3267c1f303de9 6854521facebbe13368b8638ade0c8636dcf9941 --

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
@@ -22,6 +22,21 @@ struct basic_string { typedef basic_string string; typedef basic_string wstring; +template +class basic_string_view { +public: + basic_string_view(); + basic_string_view(const basic_string_view &); + basic_string_view(const C *); +

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/72283 As per title. A small improvement to this check, `string_view` should work out of the box. I am slowly looking into adding an option to this check to recommend C++20's API `starts_with`, and move it to