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 #14689: Prevent false positives when first sentence of Javadoc is on its own line #14690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patchwork01
Copy link
Contributor

@patchwork01 patchwork01 commented Mar 19, 2024

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

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 4 times, most recently from 69c7787 to a262f21 Compare March 20, 2024 09:43
@romani
Copy link
Member

romani commented Mar 22, 2024

please squash all in single commit

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 2 times, most recently from 4310b16 to c311d18 Compare March 22, 2024 10:19
@patchwork01
Copy link
Contributor Author

please squash all in single commit

Done

@romani romani force-pushed the javadoc-summary-should-only-be-first-sentence branch from c311d18 to 02f844a Compare March 22, 2024 13:18
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 for fix.

first shallow dive in PR:

@romani
Copy link
Member

romani commented Mar 25, 2024

@patchwork01, please resolve Checker and Pitest failures.

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

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 8 times, most recently from 741f2e9 to 6cfadae Compare March 28, 2024 11:40
@romani
Copy link
Member

romani commented Mar 28, 2024

please review if we can avoid this: https://github.com/checkstyle/checkstyle/actions/runs/8466706931/job/23196469563?pr=14690#step:6:933

New surviving error(s) found:

  <checkerFrameworkError unstable="false">
    <fileName>src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java</fileName>
    <specifier>argument</specifier>
    <message>incompatible argument for parameter end of StringBuilder.append.</message>
    <lineContent>result.append(text, 0, periodIndex);</lineContent>
    <details>
      found   : int
      required: @LTEqLengthOf(&quot;text&quot;) int
    </details>
  </checkerFrameworkError>

if not, just run groovy ./.ci/checker-framework.groovy checker-index on your local and add generated update/change to suppression file to your PR. It will be red flag for each reviewer, so better to share reasons why we cannot fix it, or it is not reasonable, or ... .

@romani
Copy link
Member

romani commented Mar 28, 2024

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.

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 3 times, most recently from 2afe320 to 0563051 Compare March 30, 2024 10:16
@patchwork01
Copy link
Contributor Author

please review if we can avoid this: https://github.com/checkstyle/checkstyle/actions/runs/8466706931/job/23196469563?pr=14690#step:6:933

That's fixed now.

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.

I'm not sure what you mean. What do you want me to do?

@romani
Copy link
Member

romani commented Apr 1, 2024

please read https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#executing-generation

Example configuration in PR description and triggering for different Check - #14743

@patchwork01
Copy link
Contributor Author

patchwork01 commented Apr 2, 2024

GitHub, generate report

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

First pass:

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 2 times, most recently from d3a2680 to fc3e4f6 Compare May 3, 2024 15:46
@romani
Copy link
Member

romani commented May 3, 2024

To fix CI please rebase on latest

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 10 times, most recently from 2706e2c to b48508b Compare May 3, 2024 19:25
Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

Last from me:

@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch from b48508b to e65262f Compare May 13, 2024 08:53
@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch 3 times, most recently from aed2143 to 51d5b9d Compare May 15, 2024 19:37
@patchwork01 patchwork01 force-pushed the javadoc-summary-should-only-be-first-sentence branch from 51d5b9d to 3043b4f Compare May 15, 2024 19:39
Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

Big improvement, thanks a lot @patchwork01 !!

Edit: looks like we did not generate a regression report on the latest code, let's make sure we are good before merging.

@nrmancuso
Copy link
Member

Github, generate report

@romani romani requested a review from rnveach May 16, 2024 15:25
@romani romani assigned rnveach and unassigned nrmancuso May 16, 2024
Copy link
Contributor

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/3043b4f_2024161246/reports/diff/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants