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 #14689: Prevent false positives when first sentence of Javadoc is on its own line #14690
base: master
Are you sure you want to change the base?
Issue #14689: Prevent false positives when first sentence of Javadoc is on its own line #14690
Conversation
69c7787
to
a262f21
Compare
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
please squash all in single commit |
4310b16
to
c311d18
Compare
Done |
c311d18
to
02f844a
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.
thanks a lot for fix.
first shallow dive in PR:
...com/puppycrawl/tools/checkstyle/checks/javadoc/summaryjavadoc/InputSummaryJavadocPeriod.java
Outdated
Show resolved
Hide resolved
...ckstyle/test/chapter7javadoc/rule72thesummaryfragment/InputIncorrectSummaryJavaDocCheck.java
Outdated
Show resolved
Hide resolved
...om/puppycrawl/tools/checkstyle/checks/javadoc/summaryjavadoc/InputSummaryJavadocCorrect.java
Outdated
Show resolved
Hide resolved
@patchwork01, please resolve Checker and Pitest failures. |
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/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
741f2e9
to
6cfadae
Compare
please review if we can avoid this: https://github.com/checkstyle/checkstyle/actions/runs/8466706931/job/23196469563?pr=14690#step:6:933
if not, just run |
last testing request, please read https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#basic-difference-report-with-custom-projects-list and provide such two configs and lets test on bunch of real code. Result will be diff report, we need o make sure there is not unexpected regressions. |
2afe320
to
0563051
Compare
That's fixed now.
I'm not sure what you mean. What do you want me to do? |
please read https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#executing-generation Example configuration in PR description and triggering for different Check - #14743 |
GitHub, generate report |
GitHub, generate report |
e340daa
to
cc00495
Compare
CI is red |
ab1773f
to
9a336b9
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.
ok to merge.
Thanks a lot for your contribution
Github, generate website |
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.
First pass:
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
d3a2680
to
fc3e4f6
Compare
To fix CI please rebase on latest |
71ec4e7
to
2706e2c
Compare
2706e2c
to
b48508b
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.
Last from me:
* @param period The period character to find. | ||
* @return The string up to and excluding the period, if one was found. | ||
*/ | ||
private static Optional<String> findSentenceEnding(String text, String period) { |
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.
Why return an optional from here if the only usage we use .orElse(null)
?
final String text; | ||
if (child.getChildren().length == 0) { | ||
text = child.getText(); | ||
private static Optional<String> getFirstSentence(DetailNode ast, String period) { |
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.
Why return an optional from here if the only usage we use .orElse(null)
?
Resolves: #14689
Resolves: #14750
Resolves: #14751
Handle cases where first sentence of Javadoc is on its own line.
Handle cases where first sentence of Javadoc includes a period character without whitespace after it.
Diff Regression config: https://gist.githubusercontent.com/patchwork01/d62651d8467212daf75aff8100e813c1/raw/ac03b5b7fbcbee95f7508e40462ce97d72dfc550/my_check.xml