Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-tidy] Refactor: removed typos in 'AllowedTypes' option in various checks #122957

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vbvictor
Copy link

@vbvictor vbvictor commented Jan 14, 2025

Added right parenthesis to match left one in description of 'AllowedTypes' option.

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Jan 14, 2025

@llvm/pr-subscribers-clang-tidy

Author: Baranov Victor (vbvictor)

Changes

Added right parenthesis to match left one.


Full diff: https://github.com/llvm/llvm-project/pull/122957.diff

3 Files Affected:

  • (modified) clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst (+1-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst (+1-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst (+1-1)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst
index 01fde9580e2a08..9460802bf4eab4 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst
@@ -32,5 +32,5 @@ Options
    iteration. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
    every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
    is empty. If a name in the list contains the sequence `::` it is matched
-   against the qualified typename (i.e. `namespace::Type`, otherwise it is
+   against the qualified typename (i.e. `namespace::Type`), otherwise it is
    matched against only the type name (i.e. `Type`).
diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst
index 837283811ddcce..4ad9dac3e38f66 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst
@@ -45,7 +45,7 @@ Options
    copying. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
    every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
    is empty. If a name in the list contains the sequence `::` it is matched
-   against the qualified typename (i.e. `namespace::Type`, otherwise it is
+   against the qualified typename (i.e. `namespace::Type`), otherwise it is
    matched against only the type name (i.e. `Type`).
 
 .. option:: ExcludedContainerTypes
diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
index cc5e1ae73508c5..330ef960e9a3bb 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
@@ -68,5 +68,5 @@ Options
    Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches every type
    with suffix `Ref`, `ref`, `Reference` and `reference`. The default is
    empty. If a name in the list contains the sequence `::` it is matched against
-   the qualified typename (i.e. `namespace::Type`, otherwise it is matched
+   the qualified typename (i.e. `namespace::Type`), otherwise it is matched
    against only the type name (i.e. `Type`).

@llvmbot
Copy link
Member

llvmbot commented Jan 14, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Baranov Victor (vbvictor)

Changes

Added right parenthesis to match left one.


Full diff: https://github.com/llvm/llvm-project/pull/122957.diff

3 Files Affected:

  • (modified) clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst (+1-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst (+1-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst (+1-1)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst
index 01fde9580e2a08..9460802bf4eab4 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/performance/for-range-copy.rst
@@ -32,5 +32,5 @@ Options
    iteration. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
    every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
    is empty. If a name in the list contains the sequence `::` it is matched
-   against the qualified typename (i.e. `namespace::Type`, otherwise it is
+   against the qualified typename (i.e. `namespace::Type`), otherwise it is
    matched against only the type name (i.e. `Type`).
diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst
index 837283811ddcce..4ad9dac3e38f66 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst
@@ -45,7 +45,7 @@ Options
    copying. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
    every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
    is empty. If a name in the list contains the sequence `::` it is matched
-   against the qualified typename (i.e. `namespace::Type`, otherwise it is
+   against the qualified typename (i.e. `namespace::Type`), otherwise it is
    matched against only the type name (i.e. `Type`).
 
 .. option:: ExcludedContainerTypes
diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
index cc5e1ae73508c5..330ef960e9a3bb 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
@@ -68,5 +68,5 @@ Options
    Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches every type
    with suffix `Ref`, `ref`, `Reference` and `reference`. The default is
    empty. If a name in the list contains the sequence `::` it is matched against
-   the qualified typename (i.e. `namespace::Type`, otherwise it is matched
+   the qualified typename (i.e. `namespace::Type`), otherwise it is matched
    against only the type name (i.e. `Type`).

@vbvictor
Copy link
Author

@HerrCai0907, Could you look at this PR, please.
I have seen you doing some refactor/cleanups lately.

@vbvictor
Copy link
Author

@EugeneZelenko Ping
I would also need assistance in merging this PR since I don't have write permissions.

@EugeneZelenko
Copy link
Contributor

@EugeneZelenko Ping I would also need assistance in merging this PR since I don't have write permissions.

Sorry, I did commits so long time ago... I think @HerrCai0907 could help with that.

Comment on lines 32 to 33
iteration. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneZelenko should other single ticks also be replaced by double ticks?
For reference, generated HTML: https://clang.llvm.org/extra/clang-tidy/checks/performance/for-range-copy.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single back-ticks are for option names and values. Double back-ticks for language constructs. Since Ref, ref, etc. refers to types, double-ticks should be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍 @vbvictor Can you please also make this change?

Copy link
Author

@vbvictor vbvictor Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicovank, yes, I can make this change.
As far as I understand only Ref, ref, Reference and reference should be changed but not [Rr]ef(erence)?$.
It got a little tricky for me since Ref only refers to a suffix of a potential c++ type, so it doesn't fall into the double back-ticks category.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it also makes sense to double tick the regex (so everything here). Probably slightly easier on the eyes as a code block when generated than an italicized string.,

Copy link
Author

@vbvictor vbvictor Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected to double-ticks plus found and fixed one more file with same errors: clang-tools-extra/docs/clang-tidy/checks/bugprone/assert-side-effect.rst.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants