Skip to content

Commit

Permalink
partial revert of 47e3343 to add root modules back
Browse files Browse the repository at this point in the history
  • Loading branch information
Calixte committed Dec 24, 2021
1 parent 937168a commit 2857d03
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
Other.group = Other

Checker.name = Checker
Checker.desc = Root module of every checkstyle configuration. Cannot be deleted.
Checker.cacheFile = caches information about files that have checked ok; used to avoid repeated checks of the same files
Checker.basedir = base directory name; stripped off in messages about files
Checker.localeCountry = locale country for messages
Checker.localeLanguage = locale language for messages
Checker.charset = name of the file charset (Note: eclipse-cs plugin sets this property to the projects default charset)
Checker.fileExtensions = file extensions that are accepted (comma separated)
Checker.haltOnException = Controls whether exceptions should halt execution or not.
Checker.tabWidth = number of expanded spaces for a tab character ('\t'); used in messages and Checks that print violations on files with tabs

TreeWalker.name = TreeWalker
TreeWalker.desc = FileSetCheck TreeWalker checks individual Java source files and defines properties that are applicable to checking such files.
TreeWalker.fileExtensions = file type extension to identify java files. Setting this property is typically only required if your java source code is preprocessed before compilation and the original files do not have the extension .java
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,43 @@
"http://eclipse-cs.sourceforge.net/dtds/checkstyle-metadata_1_1.dtd">
<checkstyle-metadata>
<rule-group-metadata name="%Other.group" priority="1500">

<rule-metadata name="%Checker.name" internal-name="Checker" parent="Root" singleton="true" default-severity="warning">
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.Checker"/>
<description>%Checker.desc</description>
<property-metadata name="cacheFile" datatype="File">
<description>%Checker.cacheFile</description>
</property-metadata>
<property-metadata name="basedir" datatype="String">
<description>%Checker.basedir</description>
</property-metadata>
<property-metadata name="localeCountry" datatype="String">
<description>%Checker.localeCountry</description>
</property-metadata>
<property-metadata name="localeLanguage" datatype="String">
<description>%Checker.localeLanguage</description>
</property-metadata>
<property-metadata name="charset" datatype="String">
<description>%Checker.charset</description>
</property-metadata>
<property-metadata name="fileExtensions" datatype="String">
<description>%Checker.fileExtensions</description>
</property-metadata>
<property-metadata name="haltOnException" datatype="Boolean" default-value="true">
<description>%Checker.haltOnException</description>
</property-metadata>
<property-metadata name="tabWidth" datatype="Integer" default-value="8">
<description>%Checker.tabWidth</description>
</property-metadata>
</rule-metadata>

<rule-metadata name="%TreeWalker.name" internal-name="TreeWalker" parent="Checker"
singleton="true">
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.TreeWalker"/>
<description>%TreeWalker.desc</description>
<property-metadata name="fileExtensions" datatype="String" default-value="java">
<description>%TreeWalker.fileExtensions</description>
</property-metadata>
</rule-metadata>
</rule-group-metadata>
</checkstyle-metadata>
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.puppycrawl.tools.checkstyle.Checker;
import com.puppycrawl.tools.checkstyle.TreeWalker;

public class ChecksTest {

@Test
public void testMetadataFiles() throws Exception {
final Set<Class<?>> modules = CheckUtil.getCheckstyleModules();

// don't test root modules
modules.remove(Checker.class);
modules.remove(TreeWalker.class);

final Set<String> packages = CheckUtil.getPackages(modules);

assertTrue(modules.size() > 0, "no modules");
Expand Down

0 comments on commit 2857d03

Please sign in to comment.