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
Issue #12409: Inconsistent allowedAbbreviations #12472
Conversation
Currently, Not Focusing on CI, Once Logic is approved, I will do that |
Preappoved . |
Do you mean adding example on the website ? |
c907723
to
13139b6
Compare
@arinmodi please generate check regression report |
Github, generate report |
Analysis : If there is more Uppercase letters than specified length before "_", it is generating violation. Without "_" it is allowing +1 character cause of Camel Case. Is this expected behaviour ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected behaviour ?
Put all your concerns to input file, we will see it in details
Items
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items item
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why this is violation https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/13139b6_2022152055/reports/diff/Hbase/index.html#A1
It not more than 4 capital letters.
Items
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
Because default allowed length is 3 and Without Underscore it is allowing 4 because last character is considered as the next word's first character which should be capital in camel case. |
d6b91fa
to
cebd954
Compare
We should not treat _ as part of word. Please add this case to test input and we need to extend documentation about _ support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
|
Absolutely, input code should all possible combinations. Do not limit your creativity. |
Hey I have doubt, Suppose allowedAbbreviationLength is 3, so before "_" how many Consecutive Capital Letters should be allowed ? 3 or 4 |
@romani ? |
Hey @romani, Updated The Code to generate violation whenever more than (allowed length + 1) found |
Please keep CI green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
...ls/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameType7.java
Outdated
Show resolved
Hide resolved
dfcf457
to
aad25d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix CI violations.
Please update regression config to allow abbreviation length to be 2. To try catch some violations.
Items
...tyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameTypeSnakeStyle.java
Show resolved
Hide resolved
...tyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameTypeSnakeStyle.java
Outdated
Show resolved
Hide resolved
...tyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameTypeSnakeStyle.java
Outdated
Show resolved
Hide resolved
Github, generate report |
Report generation job failed on phase "parse_body", step "React with rocket on run". |
@romani, is it good now ? |
A way better. |
Done, Leading Numbers Not Possible |
Please add cases like TEST23456, 234VIO LATION .... |
I think java has rule that identifier must start with letter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Closes : #12409 : Inconsistent allowedAbbreviations when a method is contains an underscore
Diff Regression config: https://gist.githubusercontent.com/arinmodi/89cc612081d60d9f9b72e090df7db612/raw/7a96b0e42c45afecc39694493ede50add32fde77/config3.xml