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

Issue #12409: Inconsistent allowedAbbreviations #12472

Merged
merged 1 commit into from Dec 31, 2022

Conversation

arinmodi
Copy link
Contributor

@arinmodi arinmodi commented Nov 29, 2022

Closes : #12409 : Inconsistent allowedAbbreviations when a method is contains an underscore

Diff Regression config: https://gist.githubusercontent.com/arinmodi/89cc612081d60d9f9b72e090df7db612/raw/7a96b0e42c45afecc39694493ede50add32fde77/config3.xml

@arinmodi
Copy link
Contributor Author

Currently, Not Focusing on CI, Once Logic is approved, I will do that

@romani
Copy link
Member

romani commented Nov 29, 2022

Preappoved .
Please extend example in xdoc with underscore

@arinmodi
Copy link
Contributor Author

Preappoved . Please extend example in xdoc with underscore

Do you mean adding example on the website ?

@arinmodi arinmodi force-pushed the bug-small branch 2 times, most recently from c907723 to 13139b6 Compare November 29, 2022 11:30
@nrmancuso
Copy link
Member

@arinmodi please generate check regression report

@arinmodi
Copy link
Contributor Author

Github, generate report

@arinmodi
Copy link
Contributor Author

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 ?

Copy link
Member

@romani romani left a 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

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items item

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

Copy link
Member

@romani romani left a 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

@arinmodi
Copy link
Contributor Author

arinmodi commented Dec 1, 2022

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

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.

@arinmodi arinmodi force-pushed the bug-small branch 2 times, most recently from d6b91fa to cebd954 Compare December 1, 2022 13:57
@romani
Copy link
Member

romani commented Dec 1, 2022

We should not treat _ as part of word.
If user decided to use _ it is definitely words separation.

Please add this case to test input and we need to extend documentation about _ support.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

I

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

@arinmodi
Copy link
Contributor Author

arinmodi commented Dec 1, 2022

We should not treat _ as part of word. If user decided to use _ it is definitely words separation.

Please add this case to test input and we need to extend documentation about _ support.

getNON_ETest(), is this good example to add in test input ?

@romani
Copy link
Member

romani commented Dec 1, 2022

is this good example to add in test input ?

Absolutely, input code should all possible combinations. Do not limit your creativity.

@arinmodi
Copy link
Contributor Author

arinmodi commented Dec 1, 2022

Hey I have doubt,

Suppose allowedAbbreviationLength is 3, so before "_" how many Consecutive Capital Letters should be allowed ? 3 or 4

@arinmodi
Copy link
Contributor Author

arinmodi commented Dec 2, 2022

@romani ?

@arinmodi
Copy link
Contributor Author

Hey @romani, Updated The Code to generate violation whenever more than (allowed length + 1) found

@romani
Copy link
Member

romani commented Dec 15, 2022

Please keep CI green.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

@arinmodi arinmodi force-pushed the bug-small branch 3 times, most recently from dfcf457 to aad25d9 Compare December 15, 2022 19:55
Copy link
Member

@romani romani left a 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

@arinmodi
Copy link
Contributor Author

Github, generate report

@github-actions
Copy link
Contributor

Report generation job failed on phase "parse_body", step "React with rocket on run".
Link: https://github.com/checkstyle/checkstyle/actions/runs/3714339314

@arinmodi
Copy link
Contributor Author

@romani, is it good now ?

@romani
Copy link
Member

romani commented Dec 16, 2022

A way better.
Please add test code with digits as hint us at https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/029cc0c_2022162445/reports/diff/Hbase/index.html#A1 to let us be aware that it is part of word or not.
Leading number, trailing numbers, numbers in mid of word.

@arinmodi
Copy link
Contributor Author

A way better. Please add test code with digits as hint us at https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/029cc0c_2022162445/reports/diff/Hbase/index.html#A1 to let us be aware that it is part of word or not. Leading number, trailing numbers, numbers in mid of word.

Done, Leading Numbers Not Possible

@romani
Copy link
Member

romani commented Dec 17, 2022

Please add cases like TEST23456, 234VIO LATION ....

@arinmodi
Copy link
Contributor Author

I think java has rule that identifier must start with letter

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Good job.

@romani romani requested a review from rnveach December 18, 2022 15:59
@romani romani assigned rnveach and unassigned romani Dec 18, 2022
@rnveach rnveach merged commit d12ffc7 into checkstyle:master Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent allowedAbbreviations when a method contains an underscore
4 participants