Skip to content

Conversation

@guptapratykshh
Copy link

Issue: #17727

The default google_checks.xml configuration does not enforce the Google Style Guide rule that Javadoc summary fragments must start with a capital letter. This leads to false negatives where Javadoc summaries beginning with lowercase letters (for example, "adds an element to the list.") are not marked as violations, even though the Google Style Guide states that summaries should be "capitalized and punctuated as if it were a complete sentence."

I added the regex pattern |^\s*[a-z] to the forbiddenSummaryFragments property in the SummaryJavadoc check configuration. This pattern detects Javadoc summaries that start with optional whitespace followed by a lowercase letter, ensuring that lowercase beginnings in Javadoc are marked as violations according to the Google Style Guide.

@guptapratykshh guptapratykshh force-pushed the issue-17727-forbid-lowercase-javadoc branch 5 times, most recently from ba16b22 to 9b3c8ce Compare December 4, 2025 21:54
@guptapratykshh
Copy link
Author

@romani, Please look into this PR and review it. Thanks

@guptapratykshh
Copy link
Author

ping @romani

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.

thanks a lot !!!

tiny update to make it perfect:

<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )|^[a-z]"/>
Copy link
Member

Choose a reason for hiding this comment

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

please make indentation of attribute to be +2 from tag, you have space.

@romani romani requested a review from Zopsss December 10, 2025 13:57
@romani
Copy link
Member

romani commented Dec 10, 2025

@Zopsss , please help to review this PR, I have only minor request. I am good to merge this as soon as it is fixed.

@guptapratykshh guptapratykshh force-pushed the issue-17727-forbid-lowercase-javadoc branch from 9b3c8ce to bc5b36e Compare December 10, 2025 15:19
@guptapratykshh guptapratykshh force-pushed the issue-17727-forbid-lowercase-javadoc branch from bc5b36e to 2b78155 Compare December 10, 2025 16:49
@romani
Copy link
Member

romani commented Dec 10, 2025

Please rebase to most latest code , CI is red as reminder to you. Please follow.

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.

Thanks a lot

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.

3 participants