Skip to content

Commit

Permalink
Issue checkstyle#6570: Exclude module-info.java from Google and Sun c…
Browse files Browse the repository at this point in the history
…onfigurations
  • Loading branch information
mkroening committed Mar 19, 2019
1 parent f0d5b51 commit 706bcd2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/resources/google_checks.xml
Expand Up @@ -21,6 +21,11 @@
<property name="severity" value="warning"/>

<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/sun_checks.xml
Expand Up @@ -41,6 +41,12 @@

<property name="fileExtensions" value="java, properties, xml"/>

<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<!-- Checks that a package-info.java file exists for each package. -->
<!-- See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage -->
<module name="JavadocPackage"/>
Expand Down
Expand Up @@ -1380,6 +1380,7 @@ else if (path.toFile().getName().contains("sun")) {
}

// these modules aren't documented, but are added to the config
styleChecks.remove("BeforeExecutionExclusionFileFilter");
styleChecks.remove("TreeWalker");
styleChecks.remove("Checker");

Expand Down
8 changes: 8 additions & 0 deletions src/xdocs/config_filefilters.xml
Expand Up @@ -75,6 +75,14 @@
</subsection>
<subsection name="Example of Usage" id="BeforeExecutionExclusionFileFilter_Example_of_Usage">
<ul>
<li>
<a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources+filename%3Agoogle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+BeforeExecutionExclusionFileFilter">
Google Style</a>
</li>
<li>
<a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources+filename%3Asun_checks.xml+repo%3Acheckstyle%2Fcheckstyle+BeforeExecutionExclusionFileFilter">
Sun Style</a>
</li>
<li>
<a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+BeforeExecutionExclusionFileFilter">
Checkstyle Style</a>
Expand Down

0 comments on commit 706bcd2

Please sign in to comment.