Skip to content

Issue #15015: Update CatchParameterName format to allow unnamed catch…#15154

Merged
rnveach merged 1 commit into
checkstyle:masterfrom
checkstyle-GSoC25:catchname
Jun 30, 2024
Merged

Issue #15015: Update CatchParameterName format to allow unnamed catch…#15154
rnveach merged 1 commit into
checkstyle:masterfrom
checkstyle-GSoC25:catchname

Conversation

@mahfouz72 mahfouz72 force-pushed the catchname branch 4 times, most recently from 1ccc4ae to 7334dc4 Compare June 27, 2024 18:59
@mahfouz72

Copy link
Copy Markdown
Member Author

Github, generate site

@mahfouz72

Copy link
Copy Markdown
Member Author

Github, generate report

@github-actions

Copy link
Copy Markdown
Contributor

@nrmancuso nrmancuso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update documentation (add a bullet point) to mention that we allow underscores for unnamed variables, and update/remove the bullet point that mentions that we do not allow symbols.

@nrmancuso nrmancuso self-assigned this Jun 29, 2024
@nrmancuso nrmancuso requested a review from rnveach June 29, 2024 12:56

@nrmancuso nrmancuso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor item, last from me:

@mahfouz72 mahfouz72 force-pushed the catchname branch 2 times, most recently from cd342b3 to de2eefe Compare June 29, 2024 14:18

@nrmancuso nrmancuso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good stuff.

@nrmancuso nrmancuso assigned rnveach and unassigned nrmancuso Jun 29, 2024
@mahfouz72

Copy link
Copy Markdown
Member Author

Github, generate site

* <li>prohibits numbered abbreviations like {@code e1} or {@code t2}</li>
* <li>prohibits one letter prefixes like {@code pException}</li>
* <li>prohibits two letter abbreviations like {@code ie} or {@code ee}</li>
* <li>prohibits any other characters than letters</li>

@rnveach rnveach Jun 30, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we are going to remove this then there needs to be something equivalent that mentions the rest of the prohibitions not mentioned above. This statement covered those before.

For example, we don't say $ is prohibited, nor underscores (excluding _ alone), nor numbers. We say numbered abbreviations above, but its not just abbreviations, it is all numbers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

prohibits any other characters than letters and underscore?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

prohibits any other characters than letters and underscore?

The concern with just saying "underscore" is you have to make sure they understand underscore with anything else is disallowed. It is just a single _ which is allowed.

Truthfully, I think original wording is fine. We say first we allow _. We can say we don't allow anything other than letters. It should be understood it is top to bottom order. Allows overrides the prohibits.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Truthfully, I think original wording is fine. We say first we allow _. We can say we don't allow anything other than letters. It should be understood it is top to bottom order. Allows overrides the prohibits.

make sense. Original wording is restored

@rnveach rnveach merged commit a8ddc2c into checkstyle:master Jun 30, 2024
@mahfouz72 mahfouz72 deleted the catchname branch May 9, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Add Check Support for Java 21 Unnamed Variables & Patterns Syntax: CatchParameterName

3 participants