From 3f3e33ccfa87c326eb62ea385a95a28e72b104c6 Mon Sep 17 00:00:00 2001 From: Rick Giles Date: Fri, 20 Dec 2002 13:30:15 +0000 Subject: [PATCH] version 3.0 documentation. please double-check examples. unvalidated - validator site is currently unavailable. --- docs/anttask.html | 154 ++++++++++++++++++++++++++-------------------- docs/mystyle.css | 8 +++ 2 files changed, 96 insertions(+), 66 deletions(-) diff --git a/docs/anttask.html b/docs/anttask.html index 3367cffe2..fc5507af3 100644 --- a/docs/anttask.html +++ b/docs/anttask.html @@ -1,16 +1,19 @@ - - - + + + Checkstyle ANT Task - Version @CHECKSTYLE_VERSION@ - +

Checkstyle ANT Task - Version @CHECKSTYLE_VERSION@

Description

-

This task runs Checkstyle over specified Java files. The task has been tested using ANT 1.4.1. The latest version of checkstyle can be found at http://checkstyle.sourceforge.net/. +

This task runs Checkstyle over specified Java files. The task has been tested using ANT 1.5. +The latest version of checkstyle can be found at http://checkstyle.sourceforge.net/. This task is included in the checkstyle distribution.

Installation

@@ -35,44 +38,54 @@ This task is included in the checkstyle distribution.

Parameters

- - - + + + - - - + + + - - + + + + + + - + + + + + + + + + + + - - - + + + - - - - - - - - - + + +
AttributeDescriptionRequiredAttributeDescriptionRequired
fileFile to run checkstyle on.One of either file or at least one nested fileset elementfileFile to run checkstyle on.One of either file or at least one nested fileset element
properties - Specifies a properties file that contains the configuration options. - See here for all available configuration - options. Use the nested <property> - element to override properties in the file. This is very useful with - project specific properties like - reporting configuration. + configSpecifies a file that defines the configuration modules. + See here for a descrition of how to define a configuration.Yes
properties + Specifies a file that contains properties for + expanded property values of the configuration. NoNo
packageNamesFile + Specifies a file that contains + package names for the configuration. + No
failOnViolationSpecifies whether the build will continue even if there are violations. + Defaults to "true".No
failOnViolationSpecifies whether the build will continue even if there are violations. Defaults to "true".NofailurePropertyThe name of a property to set in the event of a violation.No
failurePropertyThe name of a property to set in the event of a violation.No
classpathThe classpath to use when looking up classes. Defaults to the current classpath.NoclasspathThe classpath to use when looking up classes. Defaults to the current classpath.No
@@ -90,13 +103,13 @@ This task is included in the checkstyle distribution.

- - - + + + - - + - + - - + - +
AttributeDescriptionRequiredAttributeDescriptionRequired
type + type

The type of output to generate. The valid values are:

  • plain - specifies the DefaultLogger
  • @@ -104,79 +117,88 @@ This task is included in the checkstyle distribution.

Defaults to "plain".

NoNo
toFileThe file to write output to. Defaults to standard output. Note, there is no way to explicitly specify standard output. + toFileThe file to write output to. Defaults to standard output. Note, there is no way to explicitly specify standard output. NoNo
-

The parameters for the <property> element are:

+

A <property> element provides a property for +expanded property values of the configuration. +The parameters for the <property> element are:

- - - + + + - - - + + + - - - + + + - - + - +
AttributeDescriptionRequiredAttributeDescriptionRequired
key

The key for the property.

Yeskey

The key for the property.

Yes
valueThe value of the property specified as a string.Either value or filevalueThe value of the property specified as a string.Either value or file
fileThe value of the property specified as a file. This is + fileThe value of the property specified as a file. This is great for specifying file names relative to the ANT build file.Either value or fileEither value or file

Examples

-

Run checkstyle on a single file

+

Run checkstyle with configuration file docs/checkstyle_checks.xml on a single file

-  <checkstyle file="Check.java"/>
+  <checkstyle config="docs/checkstyle_checks.xml" file="Check.java"/>
 
-

Run checkstyle on a set of Java files using Site-wide Checkstyle rules and overriding properties

+

Run checkstyle on a set of Java files using site-wide configuration and +an expanded property value

-  <checkstyle properties="/path/to/site/checkstyle.rules">
+  <checkstyle config="/path/to/site/checkstyle_checks.xml">
     <fileset dir="src/checkstyle" includes="**/*.java"/>
 
     <!-- Location of cache-file. Something that is project specific -->
     <property key="checkstyle.cache.file" file="target/cachefile"/>
-
-    <!-- This project allows tabs (big mistake:-) -->
-    <property key="checkstyle.allow.tabs" value="true"/>
   </checkstyle>
 

Run checkstyle on a set of files and output messages to standard output in plain format, and a file in XML format

-  <checkstyle>
+  <checkstyle config="docs/checkstyle_checks.xml">
     <fileset dir="src/checkstyle" includes="**/*.java"/>
     <formatter type="plain"/>
     <formatter type="xml" toFile="build/checkstyle_errors.xml"/>
   </checkstyle>
 
- +

+Run checkstyle with configuration file docs/checkstyle_checks.xml on a file and +provide a package names file +

+  <checkstyle config="docs/checkstyle_checks.xml"
+              packageNamesFile="myPackageNames.xml"
+              file="Check.java"/>
+
+

Run checkstyle in an automated build and send an email report if style violations are detected

   <target name="checkstyle"
           description="Generates a report of code convention violations.">
 
-    <checkstyle failureProperty="checkstyle.failure"
+    <checkstyle config="docs/checkstyle_checks.xml"
+                failureProperty="checkstyle.failure"
                 failOnViolation="false">
       <formatter type="xml" tofile="checkstyle_report.xml"/>
       <fileset dir="src" includes="**/*.java"/>
@@ -203,7 +225,7 @@ This task is included in the checkstyle distribution.

</target>
-
-

Copyright © 2001 Oliver Burn. All rights Reserved.

+
+

Copyright © 2002 Oliver Burn. All rights Reserved.

diff --git a/docs/mystyle.css b/docs/mystyle.css index 624ef61bd..e68a747ad 100644 --- a/docs/mystyle.css +++ b/docs/mystyle.css @@ -16,6 +16,14 @@ h4.tip { text-align: center; } +td { + vertical-align:top; +} + +td.required { + text-align: center; +} + tr.header { background-color: Silver; color:Black;