Issue #18644: Fix SummaryJavadoc forbiddenSummaryFragments for tab-formatted code#18650
Conversation
romani
left a comment
There was a problem hiding this comment.
do mvn verify before pushing to github.
| public class InputSummaryJavadocForbiddenFragmentsTabFormatted { | ||
| // violation below, 'Forbidden summary fragment' | ||
| /** | ||
| * adds an element to the list. |
There was a problem hiding this comment.
if there is TAB, it is not visible, use text to hint this.
* this line has tab before asterisk.
|
Hey @romani, I've added a note explaining the tab indentation before the package statement: // Note: This file uses tab indentation. The Javadoc continuation lines
// have tab characters before the asterisks (e.g., "\t *" not " *").Let me know if you'd prefer the hint in a different format. Also, the CI failures seem to be infrastructure-related (Docker build failures, etc.) rather than test failures - the tests pass locally. Could you re-trigger the CI when you get a chance? |
|
not and infra problems. Please read and watch videos at Starting_Development. |
d774470 to
21e7047
Compare
…for tab-formatted code
21e7047 to
5dd6af7
Compare
|
@romani all good? |
|
Github, generate report for SummaryJavadoc/all-examples-in-one |
|
Report for SummaryJavadoc/all-examples-in-one: |
|
@romani updates on this? |
romani
left a comment
There was a problem hiding this comment.
thanks a lot !!!
The
Google Java Style Guide explicitly mandates not using tab characters for indentation.
so it will not affect google style, even in diff report we see violations on "this method returns" (that is google style forbidden wording)
|
@pirzada-ahmadfaraz , in next PR please trigger this diff report your self and write comment to explicitly state that you reviewed all in it and all is valid changes. it will speed up PR acceptance, see you in other PR. |
Fixes #18644
Summary
The
JAVADOC_MULTILINE_TO_SINGLELINE_PATTERNregex inSummaryJavadocCheckonly matched spaces before asterisks (\n +(\*)), not tabs. When Javadoc continuation lines used tabs (e.g.,\t * text), the pattern failed to match, leaving the asterisk in the processed string.This caused
forbiddenSummaryFragmentspatterns like^[a-z]to fail because the string started with*instead of the actual summary text.Changes
\n +(\*)to\n[ \t]+(\*)to match both spaces and tabs before the asteriskTest
The new test
testForbiddenFragmentsTabFormattedverifies thatforbiddenSummaryFragments = ^[a-z]correctly detects a violation when the Javadoc summary starts with a lowercase letter in tab-formatted code.