checkstyle/docs/index.html

154 lines
6.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Checkstyle Home Page</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<!-- The header -->
<table border="0" width="100%">
<tr>
<td>
<font style="font-family: Courier New; font-size=36; font-weight:bold; color:#aaaaaa">Checkstyle Home Page</font>
</td>
<td align="right">
<img src="logo.png">
</td>
</tr>
</table>
<!-- content -->
<table border="0" width="100%" cellpadding="5">
<tr>
<!--Left menu-->
<td valign="top" align="left" nowrap="true" bgcolor="#EEEEEE">
<p>Checkstyle</p>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#download">Download</a></li>
<li><a href="java.header">License</a></li>
<li><a href="#related">Related Tools</a></li>
</ul>
<p>Documentation</p>
<ul>
<li><a href="engine.html">Core Engine</a></li>
<li><a href="anttask.html">ANT Task</a></li>
<li><a href="cmdline.html">Command Line</a></li>
</ul>
<p>SourceForge</p>
<ul>
<li><a href="http://sourceforge.net/mail/?group_id=29721">Mailing Lists</a></li>
<li><a href="http://sourceforge.net/tracker/?atid=397078&group_id=29721&func=browse">Bug Database</a></li>
<li><a href="http://sourceforge.net/tracker/?atid=397081&group_id=29721&func=browse">Feature Requests</a></li>
</ul>
<p>Developers</p>
<ul>
<li><a href="http://sourceforge.net/projects/checkstyle">Project Page</a></li>
<li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/checkstyle/">CVS Repository</a></li>
<li>JavaDoc</li>
</ul>
</td>
<!--Content-->
<td width="100%" valign="top" align="left">
<a name="overview">
<h2>Overview</h2>
<p class="body">
Checkstyle is a development tool to help programmers write Java code
that adheres to a coding standard. It automates the process
of checking Java code to spare humans of this boring (but important)
task. This makes it ideal for projects that want to enforce a coding
standard.
</p>
<p class="body">
By default it supports the <a href="http://java.sun.com/docs/codeconv/">
Sun Code Conventions</a>. However, Checkstyle is highly configurable.
</p>
<p class="body">
My experience from using a similar proprietary tool at a previous employer
was that it increased the productivity of code reviews. This is because it
allowed the reviewers to get on with reviewing the code and not get into
"style" debates.
</p>
<a name="features"></a>
<h2>Features</h2>
<p class="body">The things that checkstyle checks for are:</p>
<ul>
<li class="body">Unused or duplicate <span class="code">import</span> statements. Note: this can be turned off.</li>
<li class="body">Javadoc comments are defined for class, interface, variable and method declarations. Note: This can be made to check only <span class="code">public</span> and <span class="code">protected</span> declarations.</li>
<li class="body">Javadoc tags for a method match the actual code.</li>
<li class="body">The file starts with a specified header. This is useful to ensure that a file has a copyright notice.</li>
<li class="body">An <span class="code">@author</span> tag exists for class and interface Javadoc comments. Note: this can be turned off.</li>
<li class="body">Format of variable names match specified regular expressions. For example, can enforce that all <span class="code">static</span> variables must start with <span class="code">"s"</span>.</li>
<li class="body">Format of class and interface names match a specified regular expression.</li>
<li class="body">Format of parameter names match a specified regular expression.</li>
<li class="body">Variables that are not declared as <span class="code">private</span> or <span class="code">protected</span>.</li>
<li class="body">Correct use of white space around binary and unary operators. For example, <span class="code">x -=- 1;</span> is illegal, whereas <span class="code">x -= -1;</span> is not.</li>
<li class="body">Ensure white space follows casts and commas. For example both <span class="code">x = (File)obj</span> and <span class="code">run(arg1,arg2)</span> are illegal, whereas <span class="code">x = (File) obj</span> and <span class="code">run(arg1, arg2)</span> are not. Note: these checks can be turned off.</li>
<li class="body">Ensure <span class="code">{}</span>'s are used for <span class="code">if/while/for/do</span> constructs.</li>
<li class="body">Lines do not contain tabs. Note: this check can be turned off.</li>
<li class="body">Lines are not longer than a specified length.</li>
<li class="body">Methods/Constructors are not longer than a specified number of lines.</li>
<li class="body">Files are not longer than a specified number of lines.</li>
</ul>
<a name="download"></a>
<h2>Download</h2>
<p class="body">
The latest release of Checkstyle can be downloaded from <a href="http://sourceforge.net/project/showfiles.php?group_id=29721">the SourceForge download page</a>.
</p>
<p class="body">
If you want to live on the bleeding edge, you can <a href="http://sourceforge.net/cvs/?group_id=29721">checkout the current development code from CVS</a> and compile yourself.
</p>
<a name="related"></a>
<h2>Related Tools</h2>
<p class="body">
Checkstyle is most useful if you integrate it in your build process or your development environment. The distribution includes:
</p>
<ul>
<li class="body">An <a href="http://jakarta.apache.org/ant/index.html">Ant</a> task.</li>
<li class="body">A command line tool.</li>
</ul>
<p class="body">
Additionally
</p>
<ul>
<li class="body">Angus Chan has written <a href="http://jbcheckstyle.sourceforge.net">jbCheckStyle</a>, an Open Tool for JBuilder.</li>
<li class="body">Markus Mohnen has written a nice interface to Checkstyle for the <a href="http://jde.sunsite.dk">Emacs JDE</a>. It is available from <a href="http://jde.sunsite.dk/contributions.html">http://jde.sunsite.dk/contributions.html</a>. Highly recommended if you are using the JDE.</li>
</ul>
</p>
<p class="body">
If you have written a plugin for other IDEs, like <a href="http://www.netbeans.org">Netbeans</a> or <a href="http://www.eclipse.org/">Eclipse</a>, please <a href="mailto:checkstyle@puppycrawl.com">let us know</a>, so we can provide a link here.
</p>
</td>
</tr>
</table>
<hr>
<p align="center">Copyright &copy; 2001 Oliver Burn. All rights Reserved.</p>
</body> </html>