Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[2e6deb]: docs / cmdline.html Maximize Restore History

Download this file

cmdline.html    144 lines (130 with data), 6.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>checkstyle Command Line</title>
<style>
span.default {white-space: nowrap;font-family: monospace;font-size: x-small;}
</style>
</head>
<body>
<h2><a name="checkstyle">checkstyle Command Line</a></h2>
<h3>Description</h3>
<p>This document describes how to run checkstyle using the command line tool. The latest version of checkstyle can be found at
<a href="http://www.puppycrawl.com/checkstyle">http://www.puppycrawl.com/checkstyle</a>.
This command line tool is included in the checkstyle distribution.</p>
<h3>Installation</h3>
<p>The easiest way is to include <span class="default">checkstyle-all-1.3.jar</span> in the classpath. This contains all the classes required to run checkstyle. Alternatively, you must include the following in the classpath:</p>
<ol>
<li><span class="default">checkstyle-1.3.jar</span></li>
<li>ANTLR 2.7.1 classes. <span class="default">antlr.jar</span> is included in the distribution.</li>
<li>Jakarta Regexp 1.2 classes. <span class="default">jakarta-regexp-1.2.jar</span> is included in the distribution.</li>
</ol>
<h3>Usage</h3>
<p>The command line usage is:</p>
<pre>
java -D&lt;property&gt;=&lt;value&gt; com.puppycrawl.tools.checkstyle.Main file...
</pre>
<p>checkstyle will process the specified files and report errors to standard error. The default behaviour of checkstyle can be changed by setting system properties using the <code>-D&lt;property&gt;=&lt;value&gt;</code> arguments to java. The following table describes what properties can be set:</p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Property</b></td>
<td valign="top"><b>Description</b></td>
</tr>
<tr>
<td valign="top">checkstyle.allow.tabs</td>
<td valign="top">Indicates whether to allow tabs. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.allow.protected</td>
<td valign="top">Indicates whether to allow protected data. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.allow.noauthor</td>
<td valign="top">Indicates whether to allow no <span class="default">@author</span> tag to be defined for class and interface Javadoc comments. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.maxlinelen</td>
<td valign="top">Specifies the maximum line length. Default value is defined <a href="index.html#length">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.ignore.importlength</td>
<td valign="top">Specifies whether to ignore the maximum line length for <span class="code">import</span> statements. Defaults to <span class="default">&quot;false&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.pattern.member</td>
<td valign="top">Specifies the regular expression to match against member variables. Default value is defined <a href="index.html#varformat">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.pattern.publicmember</td>
<td valign="top">Specifies the regular expression to match against public member variables. Default value is defined <a href="index.html#fieldformat">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.pattern.parameter</td>
<td valign="top">Specifies the regular expression to match against parameters. Default value is defined <a href="index.html#paramformat">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.pattern.const</td>
<td valign="top">Specifies the regular expression to match against static/final variables. Default value is defined <a href="index.html#varformat">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.pattern.static</td>
<td valign="top">Specifies the regular expression to match against static variables. Default value is defined <a href="index.html#varformat">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.pattern.type</td>
<td valign="top">Specifies the regular expression to match against type names. Default value is defined <a href="index.html#typeformat">here</a>.</td>
</tr>
<tr>
<td valign="top">checkstyle.header.file</td>
<td valign="top">Specifies the file containing the header lines. Default is to not check.</td>
</tr>
<tr>
<td valign="top">checkstyle.header.ignoreline</td>
<td valign="top">Specifies the line in the header to ignore when comparing. Default it to not ignore any line.</td>
</tr>
<tr>
<td valign="top">checkstyle.javadoc.relax</td>
<td valign="top">Specifies whether to relax checking Javadoc comments. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.javadoc.ignore</td>
<td valign="top">Specifies whether to completely ignore checking Javadoc comments. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.ignore.imports</td>
<td valign="top">Specifies whether to ignore checking import statements. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.ignore.whitespace</td>
<td valign="top">Specifies whether to ignore checking whitespace. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.ignore.braces</td>
<td valign="top">Specifies whether to ignore checking braces. Defaults to <span class="default">&quot;no&quot;</span>.</td>
</tr>
<tr>
<td valign="top">checkstyle.cache.file</td>
<td valign="top">Specifies the name of a file that can be used to cache details of files that pass checkstyle. This can signicantly increase the speed of checkstyle on successive runs.</td>
</tr>
</table>
<h3>Examples</h3>
<p><b>Run checkstyle on a file</b></p>
<pre>
java com.puppycrawl.tools.checkstyle.Main Check.java
</pre>
<p><b>Run checkstyle on a file and allow tabs</b></p>
<pre>
java -Dcheckstyle.allow.tabs=yes com.puppycrawl.tools.checkstyle.Main Check.java
</pre>
<p><b>Run checkstyle on a file and disable pattern matching</b></p>
<pre>
java -Dcheckstyle.pattern.parameter=. \
-Dcheckstyle.pattern.static=. \
-Dcheckstyle.pattern.const=. \
-Dcheckstyle.pattern.member=. \
com.puppycrawl.tools.checkstyle.Main Check.java
</pre>
<hr>
<p align="center">Copyright &copy; 2001 Oliver Burn. All rights Reserved.</p>
</body>
</html>