From b07067274bf66381b664669709a816eef0b6500c Mon Sep 17 00:00:00 2001 From: Oliver Burn Date: Mon, 21 Jan 2002 03:41:07 +0000 Subject: [PATCH] first cut --- docs/engine.html | 232 +++++++++++++++++++++++++++++++++++++++++++++++ docs/logo.png | Bin 0 -> 3089 bytes 2 files changed, 232 insertions(+) create mode 100644 docs/engine.html create mode 100644 docs/logo.png diff --git a/docs/engine.html b/docs/engine.html new file mode 100644 index 000000000..157cbb370 --- /dev/null +++ b/docs/engine.html @@ -0,0 +1,232 @@ + + + + + Checkstyle Core Engine + + + + +

Checkstyle Core Engine

+ +

Author: Oliver Burn

+ +

Introduction

+

This document describes the core engine of Checkstyle, including what checks it performs and how it can be configured. The engine can be executed via different interfaces. The standard distribution included support for: + +

+

+ + +

system requirements

+

To run checkstyle you will need:

+ + +

Checkstyle has been tested using: +

+

+ + +

What checkstyle checks

+ +

Unused Imports

+

Checks for import statements that are not used. It will warn about wild-card imports like import java.io.*;. It will also warn about duplicate import statements.

+ +

Removing unused import statements reduces unnecessary dependencies in a code base. This feature can be turned off.

+ +

Javadoc tags

+ +

Checks that the following constructs have a Javadoc comment:

+ + +

Javadoc comments for class and interface declarations are checked to ensure that the @author tag exists. This can be turned off.

+ +

You can control the visibility scope where Javadoc comments are checked. For example, you can check Javadoc code only for public and protected variables, methods, interfaces and class definitions. Scoping rules apply, in the above example a public method in a package visible class is not checked. You can also completely turn off all checking for Javadoc comments.

+ +

Javadoc comments for methods are checked to ensure that the following tags exist (if required):

+ + +

For example the following is valid:

+
+    /**
+     * Checks for a return tag.
+     * @return the index of the next unchecked tag
+     * @param aTagIndex the index to start in the tags
+     * @param aTags the tags to check
+     * @param aLineNo the line number of the expected tag
+     **/
+    public int checkReturnTag(final int aTagIndex,
+                              JavadocTag[] aTags,
+                              int aLineNo)
+
+ +
+

Tip

+

It can be extremely painful writing or duplicating Javadoc for a method required for an interface. Hence checkstyle supports using the convention of using a single @see tag instead of all the other tags. For example, if the previous method was implementing a method required by the com.puppycrawl.tools.checkstyle.Verifier interface, then the Javadoc could be done as:

+ +
+    /** @see com.puppycrawl.tools.checkstyle.Verifier **/
+    public int checkReturnTag(final int aTagIndex,
+                              JavadocTag[] aTags,
+                              int aLineNo)
+
+
+ +

Long Lines

+

Checks for lines that are longer that a specified length. The default is "80". This can be turned off for import statements.

+ +

Method Body Length

+

Checks for method bodies that are longer that a specified number of lines. The default is "150". + +

Constructor Body Length

+

Checks for constructor bodies that are longer that a specified number of lines. The default is "150". + +

File Length

+

Checks for files that are longer that a specified number of lines. The default is "2000". + +

Tab characters

+

Checks for lines that contain tab ('\t') characters. This can be turned off.

+ +

Format of variable names

+

Verifies that the format of the variable names conform to a specified regular expression. The formats can be overridden. The following table outlines the defaults:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ScopeDefault FormatExample
Constants (static and final)^[A-Z]([A-Z0-9_]*[A-Z0-9])?$
The exception to the rule is for serialVersionUID.
public static final int MAX_ROWS = 2;
Static variables (static only)^[a-z][a-zA-Z0-9]*$private static int numCreated = 0;
Members (non static)^[a-z][a-zA-Z0-9]*$private int mySize = 0;
Public members (non static public)^f[A-Z][a-zA-Z0-9]*$public int fCMPField;
+ +

The default values prior to release 1.4 were:

+ + + + + + + + + + + + + +
ScopeOld Format
static only^s[A-Z][a-zA-Z0-9]*$
non static^m[A-Z][a-zA-Z0-9]*$
+ +

Format of parameter names

+

Verifies that the format of parameter names conform to a specified regular expression. The default is ^[a-z][a-zA-Z0-9]*$. The default value prior to release 1.4 was ^a[A-Z][a-zA-Z0-9]*$.

+ + +

Format of type names

+

Verifies that the format of class and interface names conform to a specified regular expression. The default is ^[A-Z][a-zA-Z0-9]*$.

+ + +

Format of public member names

+

Verifies that the format of public member names conform to a specified regular expression. The default is ^f[A-Z][a-zA-Z0-9]*$. This is useful for the fields required for Container Managed Persistence (CMP) Enterprise JavaBeans 1.1.

+ + +

Access Permissions

+

Checks for data members that are not declared private. Also finds static non-final data members that are not declared as private.

+ +

Note: you can turn on allowing protected data members.

+ +
+

Tip

+

Container Managed Persistence EJBs require that managed fields are declared public. This will cause checkstyle to complain that the fields should be declared private. Hence checkstyle supports ignoring public that match a specified regular expression. The default is ^f[A-Z][a-zA-Z0-9]*$.

+
+ +

White space

+

Checks for the following use of white space:

+ + +

This feature can be turned off.

+ + +

Missing Braces

+

Checks for missing braces {}'s for the following constructs:

+ + +

This feature can be turned off.

+ + +

File Header

+

Ensure that the file starts with a specified header. The header contents are specified in a file. If no file is specified, checkstyle does not check for a header.

+ +
+

Tip

+

Most copyright headers will contain date information (for example the year) which will change over time. To support this, checkstyle supports specifying a line in the header to ignore when comparing the start of the file with the header. For example, consider the following header:

+ +
+line 1: ///////////////////////////////////////////////////////////////////////
+line 2: // checkstyle: Checks Java source code for adherence to a set of rules.
+line 3: // Copyright (C) 2001  Oliver Burn
+line 4: ///////////////////////////////////////////////////////////////////////
+
+ +

Since the year information will change over time, you can tell checkstyle to ignore line 3.

+
+ + + +
+

Copyright © 2001 Oliver Burn. All rights Reserved.

+ + diff --git a/docs/logo.png b/docs/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..55fe8271ce601043090fed26a4e0df6e779cfcaf GIT binary patch literal 3089 zcmYjTc~}$I7M~@1LJ|@Z5|A(`6p#cXi?tec0;o|CA|MTdIEg`GMT=H#u+&ZI=HC0wIrseT{r&Da zce^%qAuE6d0D#XTO;S498p-!V226h4*ZBElLn%-%Q3Jr=``@QlKP1P}P4jh|GCp3t z=~Mm2d_Zmd*pQDbTBk3_PtVsIi#H79t4JfIHYIcZ>sP&R^BsftOBi4vw5>Xbj~aC@!rAL|6L`xW%btD0!)gFb+7*_95Ei2^92*-OC|e6a zRh;CmCJZmz!8Y>Xz*vT(ee@d0M>%6wu_sU?p6-ZA1OvH0kcO&c$+)zu%PZdSN$gAD zD3#)q0QRD(dy9Z?d#IfZ-%Z1ETdPwkL~uzzQxUz* zc01Q*qUTU*C$BHMZr{h62o;KH_u{T<_+U3SH{k_;c@s$C!^KOX=QNua!;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