Add checkstyle rule to forbid empty javadoc comments (#20881)

This commit adds a RegexpMultiline check to checkstyle that yells when an empty Javadoc comment is found in Java files.

Related #20871
This commit is contained in:
Tanguy Leroux 2016-11-21 12:36:44 +01:00 committed by GitHub
parent 496afbbda5
commit e7b9e65fc3
3 changed files with 8 additions and 4 deletions

View File

@ -10,6 +10,13 @@
<property name="file" value="${suppressions}" /> <property name="file" value="${suppressions}" />
</module> </module>
<!-- Checks Java files and forbids empty Javadoc comments -->
<module name="RegexpMultiline">
<property name="format" value="\/\*[\s\*]*\*\/"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Empty javadoc comments are forbidden"/>
</module>
<module name="TreeWalker"> <module name="TreeWalker">
<!-- Its our official line length! See checkstyle_suppressions.xml for the files that don't pass this. For now we <!-- Its our official line length! See checkstyle_suppressions.xml for the files that don't pass this. For now we
suppress the check there but enforce it everywhere else. This prevents the list from getting longer even if it is suppress the check there but enforce it everywhere else. This prevents the list from getting longer even if it is

View File

@ -1053,8 +1053,6 @@ public class SimpleNestedIT extends ESIntegTestCase {
assertThat(clusterStatsResponse.getIndicesStats().getSegments().getBitsetMemoryInBytes(), equalTo(0L)); assertThat(clusterStatsResponse.getIndicesStats().getSegments().getBitsetMemoryInBytes(), equalTo(0L));
} }
/**
*/
private void assertDocumentCount(String index, long numdocs) { private void assertDocumentCount(String index, long numdocs) {
IndicesStatsResponse stats = admin().indices().prepareStats(index).clear().setDocs(true).get(); IndicesStatsResponse stats = admin().indices().prepareStats(index).clear().setDocs(true).get();
assertNoFailures(stats); assertNoFailures(stats);
@ -1062,5 +1060,4 @@ public class SimpleNestedIT extends ESIntegTestCase {
} }
} }

View File

@ -68,7 +68,7 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase {
public static final String REST_TESTS_SUITE = "tests.rest.suite"; public static final String REST_TESTS_SUITE = "tests.rest.suite";
/** /**
* Property that allows to blacklist some of the REST tests based on a comma separated list of globs * Property that allows to blacklist some of the REST tests based on a comma separated list of globs
* e.g. -Dtests.rest.blacklist=get/10_basic/* * e.g. "-Dtests.rest.blacklist=get/10_basic/*"
*/ */
public static final String REST_TESTS_BLACKLIST = "tests.rest.blacklist"; public static final String REST_TESTS_BLACKLIST = "tests.rest.blacklist";
/** /**