Skip to content

Commit

Permalink
Issue checkstyle#12520: removes missing package-info Javadoc check in…
Browse files Browse the repository at this point in the history
… JavadocStyle
  • Loading branch information
rnveach committed Dec 12, 2022
1 parent 8382d88 commit 9243d47
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 153 deletions.
77 changes: 38 additions & 39 deletions config/archunit-store/slices_should_be_free_of_cycles_suppressions

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Expand Up @@ -66,8 +66,7 @@
* a previous open tag.
* </li>
* <li>
* Check that a package Javadoc comment is well-formed (as described above) and
* NOT missing from any package-info.java files.
* Check that a package Javadoc comment is well-formed (as described above).
* </li>
* <li>
* Check for allowed HTML tags. The list of allowed HTML tags is
Expand Down Expand Up @@ -288,9 +287,6 @@
* {@code javadoc.incompleteTag}
* </li>
* <li>
* {@code javadoc.missing}
* </li>
* <li>
* {@code javadoc.noPeriod}
* </li>
* <li>
Expand All @@ -304,9 +300,6 @@
public class JavadocStyleCheck
extends AbstractCheck {

/** Message property key for the Missing Javadoc message. */
public static final String MSG_JAVADOC_MISSING = "javadoc.missing";

/** Message property key for the Empty Javadoc message. */
public static final String MSG_EMPTY = "javadoc.empty";

Expand Down Expand Up @@ -447,16 +440,7 @@ else if (!ScopeUtil.isInCodeBlock(ast)) {
* @see #checkHtmlTags(DetailAST, TextBlock)
*/
private void checkComment(final DetailAST ast, final TextBlock comment) {
if (comment == null) {
// checking for missing docs in JavadocStyleCheck is not consistent
// with the rest of CheckStyle... Even though, I didn't think it
// made sense to make another check just to ensure that the
// package-info.java file actually contains package Javadocs.
if (CheckUtil.isPackageInfo(getFilePath())) {
log(ast, MSG_JAVADOC_MISSING);
}
}
else {
if (comment != null) {
if (checkFirstSentence) {
checkFirstSentenceEnding(ast, comment);
}
Expand Down
Expand Up @@ -31,8 +31,7 @@
a previous open tag.
&lt;/li&gt;
&lt;li&gt;
Check that a package Javadoc comment is well-formed (as described above) and
NOT missing from any package-info.java files.
Check that a package Javadoc comment is well-formed (as described above).
&lt;/li&gt;
&lt;li&gt;
Check for allowed HTML tags. The list of allowed HTML tags is
Expand Down
Expand Up @@ -23,7 +23,6 @@
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_EMPTY;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_EXTRA_HTML;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_INCOMPLETE_TAG;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_JAVADOC_MISSING;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_NO_PERIOD;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_UNCLOSED_HTML;

Expand Down Expand Up @@ -483,17 +482,6 @@ public void packageInfoAnnotation() throws Exception {
expected);
}

@Test
public void packageInfoMissing() throws Exception {
final String[] expected = {
"16:1: " + getCheckMessage(MSG_JAVADOC_MISSING),
};

verifyWithInlineConfigParser(
getPath("bothfiles" + File.separator + "package-info.java"),
expected);
}

@Test
public void packageInfoValid() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
Expand Down

This file was deleted.

6 changes: 1 addition & 5 deletions src/xdocs/config_javadoc.xml
Expand Up @@ -1519,7 +1519,7 @@ public class TestClass {
</li>
<li>
Check that a package Javadoc comment is well-formed (as
described above) and NOT missing from any package-info.java files.
described above).
</li>
<li>
Check for allowed HTML tags. The list of allowed HTML tags
Expand Down Expand Up @@ -1824,10 +1824,6 @@ public class Test {
<a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fjavadoc+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22javadoc.incompleteTag%22">
javadoc.incompleteTag</a>
</li>
<li>
<a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fjavadoc+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22javadoc.missing%22">
javadoc.missing</a>
</li>
<li>
<a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fjavadoc+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22javadoc.noPeriod%22">
javadoc.noPeriod</a>
Expand Down

0 comments on commit 9243d47

Please sign in to comment.