Skip to content

Commit

Permalink
Issue checkstyle#11163: Enforced filesize PositionSingleline//
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and romani committed Jan 15, 2024
1 parent e4ea500 commit 2f49e8d
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 281 deletions.
2 changes: 0 additions & 2 deletions config/checkstyle-input-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,6 @@
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPosition.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPositionOnlyComments.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPositionWithSinglelineComments.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocTokensPass.java"/>
<suppress id="UnnecessaryOkComment"
Expand Down
2 changes: 0 additions & 2 deletions config/checkstyle-resources-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@
<!-- Until https://github.com/checkstyle/checkstyle/issues/11163 -->
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPosition\.java"/>
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPositionWithSinglelineComments\.java"/>
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocNonTightHtmlTagsNoViolation\.java"/>
<suppress checks="FileLength"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,42 @@ public void testPosition() throws Exception {
}

@Test
public void testPositionWithSinglelineComments() throws Exception {
public void testPositionWithSinglelineCommentsOne() throws Exception {
JavadocCatchCheck.clearCounter();
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(
getPath("InputAbstractJavadocPositionWithSinglelineComments.java"), expected);
getPath("InputAbstractJavadocPositionWithSinglelineCommentsOne.java"), expected);
assertWithMessage("Invalid number of javadocs")
.that(JavadocCatchCheck.javadocsNumber)
// until https://github.com/checkstyle/checkstyle/issues/12586
// actual javadoc count is 65, but verifyWithInlineConfigParser verify file twice
.isEqualTo(130);
// actual javadoc count is 21, but verifyWithInlineConfigParser verify file twice
.isEqualTo(42);
}

@Test
public void testPositionWithSinglelineCommentsTwo() throws Exception {
JavadocCatchCheck.clearCounter();
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(
getPath("InputAbstractJavadocPositionWithSinglelineCommentsTwo.java"), expected);
assertWithMessage("Invalid number of javadocs")
.that(JavadocCatchCheck.javadocsNumber)
// until https://github.com/checkstyle/checkstyle/issues/12586
// actual javadoc count is 29, but verifyWithInlineConfigParser verify file twice
.isEqualTo(58);
}

@Test
public void testPositionWithSinglelineCommentsThree() throws Exception {
JavadocCatchCheck.clearCounter();
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(
getPath("InputAbstractJavadocPositionWithSinglelineCommentsThree.java"), expected);
assertWithMessage("Invalid number of javadocs")
.that(JavadocCatchCheck.javadocsNumber)
// until https://github.com/checkstyle/checkstyle/issues/12586
// actual javadoc count is 15, but verifyWithInlineConfigParser verify file twice
.isEqualTo(30);
}

@Test
Expand Down

This file was deleted.

Loading

0 comments on commit 2f49e8d

Please sign in to comment.