diff --git a/docs/anttask.html b/docs/anttask.html index 670ac3303..3367cffe2 100644 --- a/docs/anttask.html +++ b/docs/anttask.html @@ -49,8 +49,10 @@ This task is included in the checkstyle distribution.

Specifies a properties file that contains the configuration options. See here for all available configuration - options. Can override properties in the file using the nested - <property> elements. + options. Use the nested <property> + element to override properties in the file. This is very useful with + project specific properties like + reporting configuration. No diff --git a/docs/cmdline.html b/docs/cmdline.html index 80fa9041d..02fea565f 100644 --- a/docs/cmdline.html +++ b/docs/cmdline.html @@ -27,7 +27,8 @@ This command line tool is included in the checkstyle distribution.

Usage

The command line usage is:

-  java com.puppycrawl.tools.checkstyle.Main \
+  java -D<property>=<value>  \
+       com.puppycrawl.tools.checkstyle.Main \
        [-f <format>] [-p <propertiesFile>] [-o <file>] [-r <dir>] file...
 
@@ -35,11 +36,19 @@ This command line tool is included in the checkstyle distribution.

+

The default behaviour of checkstyle can be changed either by setting system +properties using the -D<property>=<value> arguments +to java or by specifying a property file using the -p option. +See here for all available configuration options. +If a property file is specified the system properties are ignored. The +following table describes what properties can be set:

+ +

Examples

Run checkstyle on a file

@@ -58,12 +67,24 @@ This command line tool is included in the checkstyle distribution.

-p myCheckstyle.properties Check.java -

Run checkstyle on a file and output to a file in XML format

+

Run checkstyle on a file and output to a file in XML format with Australian localisation

-  java  com.puppycrawl.tools.checkstyle.Main \
+  java  -Dcheckstyle.allow.tabs=yes  \
+        -Dcheckstyle.locale.language=en \
+        -Dcheckstyle.locale.language=au \
+        com.puppycrawl.tools.checkstyle.Main \
         -f xml -o build/checkstyle_errors.xml Check.java
 
+

Run checkstyle on a file and disable pattern matching

+
+  java  -Dcheckstyle.pattern.parameter=. \
+        -Dcheckstyle.pattern.static=. \
+        -Dcheckstyle.pattern.const=. \
+        -Dcheckstyle.pattern.member=. \
+        com.puppycrawl.tools.checkstyle.Main Check.java
+
+

Tip

It is possible to run Checkstyle directly from the JAR file using the -jar option. Example would be: