0
|
1 |
'\" t
|
|
2 |
.\"
|
11
|
3 |
.\" Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
0
|
4 |
.\" Use is subject to license terms.
|
|
5 |
.\"
|
11
|
6 |
.\"ident "@(#)pylint.1.sunman 1.2 10/03/16 SMI"
|
0
|
7 |
.\"
|
|
8 |
.TH pylint 1 "2008-10-13" pylint
|
|
9 |
.SH NAME
|
|
10 |
.B pylint
|
|
11 |
\- python code static checker
|
|
12 |
|
|
13 |
.SH SYNOPSIS
|
|
14 |
.B pylint
|
|
15 |
[
|
|
16 |
.I OPTIONS
|
|
17 |
] [
|
|
18 |
.I <arguments>
|
|
19 |
]
|
|
20 |
|
|
21 |
.SH DESCRIPTION
|
|
22 |
.B pylint
|
|
23 |
is a Python source code analyzer which looks for programming
|
|
24 |
errors, helps enforcing a coding standard and sniffs for some code
|
|
25 |
smells (as defined in Martin Fowler's Refactoring book)
|
|
26 |
|
|
27 |
Pylint can be seen as another PyChecker since nearly all tests you
|
|
28 |
can do with PyChecker can also be done with Pylint. However, Pylint
|
|
29 |
offers some more features, like checking length of lines of code,
|
|
30 |
checking if variable names are well-formed according to your coding
|
|
31 |
standard, or checking if declared interfaces are truly implemented,
|
|
32 |
and much more.
|
|
33 |
|
|
34 |
Additionally, it is possible to write plugins to add your own checks.
|
|
35 |
|
|
36 |
.SH OPTIONS
|
|
37 |
.IP "--version"
|
|
38 |
show program's version number and exit
|
|
39 |
.IP "--help, -h"
|
|
40 |
show this help message and exit
|
|
41 |
|
|
42 |
.SH MASTER
|
|
43 |
.IP "--rcfile=<file>"
|
|
44 |
Specify a configuration file.
|
|
45 |
.IP "--init-hook=<code>"
|
|
46 |
Python code to execute, usually for sys.path manipulation such as pygtk.require().
|
|
47 |
.IP "--errors-only, -e"
|
|
48 |
In debug mode, checkers without error messages are disabled and for others, only the ERROR messages are displayed, and no reports are done by default
|
|
49 |
.IP "--profile=<y_or_n>"
|
|
50 |
Profiled execution. [current: no]
|
|
51 |
.IP "--ignore=<file>"
|
|
52 |
Add <file or directory> to the black list. It should be a base name, not a path. You may set this option multiple times. [current: CVS]
|
|
53 |
.IP "--persistent=<y_or_n>"
|
|
54 |
Pickle collected data for later comparisons. [current: yes]
|
|
55 |
.IP "--cache-size=<size>"
|
|
56 |
Set the cache size for astng objects. [current: 500]
|
|
57 |
.IP "--load-plugins=<modules>"
|
|
58 |
List of plugins (as comma separated values of python modules names) to load, usually to register additional checkers. [current: none]
|
|
59 |
|
|
60 |
.SH COMMANDS
|
|
61 |
.IP "--help-msg=<msg-id>"
|
|
62 |
Display a help message for the given message id and exit. The value may be a comma separated list of message ids.
|
|
63 |
.IP "--list-msgs"
|
|
64 |
Generate pylint's full documentation.
|
|
65 |
.IP "--generate-rcfile"
|
|
66 |
Generate a sample configuration file according to the current configuration. You can put other options before this one to get them in the generated configuration.
|
|
67 |
.IP "--generate-man"
|
|
68 |
Generate pylint's man page.
|
|
69 |
|
|
70 |
.SH MESSAGES CONTROL
|
|
71 |
.IP "--enable-checker=<checker ids>"
|
|
72 |
Enable only checker(s) with the given id(s). This option conflicts with the disable-checker option
|
|
73 |
.IP "--disable-checker=<checker ids>"
|
|
74 |
Enable all checker(s) except those with the given id(s). This option conflicts with the enable-checker option
|
|
75 |
.IP "--enable-msg-cat=<msg cats>"
|
|
76 |
Enable all messages in the listed categories.
|
|
77 |
.IP "--disable-msg-cat=<msg cats>"
|
|
78 |
Disable all messages in the listed categories.
|
|
79 |
.IP "--enable-msg=<msg ids>"
|
|
80 |
Enable the message(s) with the given id(s).
|
|
81 |
.IP "--disable-msg=<msg ids>"
|
|
82 |
Disable the message(s) with the given id(s).
|
|
83 |
|
|
84 |
.SH REPORTS
|
|
85 |
.IP "--output-format=<format>, -f <format>"
|
|
86 |
Set the output format. Available formats are text, parseable, colorized, msvs (visual studio) and html [current: text]
|
|
87 |
.IP "--include-ids=<y_or_n>, -i <y_or_n>"
|
|
88 |
Include message's id in output [current: no]
|
|
89 |
.IP "--files-output=<y_or_n>"
|
|
90 |
Put messages in a separate file for each module / package specified on the command line instead of printing them on stdout. Reports (if any) will be written in a file name "pylint_global.[txt|html]". [current: no]
|
|
91 |
.IP "--reports=<y_or_n>, -r <y_or_n>"
|
|
92 |
Tells wether to display a full report or only the messages [current: yes]
|
|
93 |
.IP "--evaluation=<python_expression>"
|
|
94 |
Python expression which should return a note less than 10 (10 is the highest note). You have access to the variables errors warning, statement which respectivly contain the number of errors / warnings messages and the total number of statements analyzed. This is used by the global evaluation report (R0004). [current: 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)]
|
|
95 |
.IP "--comment=<y_or_n>"
|
|
96 |
Add a comment according to your evaluation note. This is used by the global evaluation report (R0004). [current: no]
|
|
97 |
.IP "--enable-report=<rpt ids>"
|
|
98 |
Enable the report(s) with the given id(s).
|
|
99 |
.IP "--disable-report=<rpt ids>"
|
|
100 |
Disable the report(s) with the given id(s).
|
|
101 |
|
|
102 |
.SH DESIGN
|
|
103 |
.IP "--max-args=<int>"
|
|
104 |
Maximum number of arguments for function / method [current: 5]
|
|
105 |
.IP "--max-locals=<int>"
|
|
106 |
Maximum number of locals for function / method body [current: 15]
|
|
107 |
.IP "--max-returns=<int>"
|
|
108 |
Maximum number of return / yield for function / method body [current: 6]
|
|
109 |
.IP "--max-branchs=<int>"
|
|
110 |
Maximum number of branch for function / method body [current: 12]
|
|
111 |
.IP "--max-statements=<int>"
|
|
112 |
Maximum number of statements in function / method body [current: 50]
|
|
113 |
.IP "--max-parents=<num>"
|
|
114 |
Maximum number of parents for a class (see R0901). [current: 7]
|
|
115 |
.IP "--max-attributes=<num>"
|
|
116 |
Maximum number of attributes for a class (see R0902). [current: 7]
|
|
117 |
.IP "--min-public-methods=<num>"
|
|
118 |
Minimum number of public methods for a class (see R0903). [current: 2]
|
|
119 |
.IP "--max-public-methods=<num>"
|
|
120 |
Maximum number of public methods for a class (see R0904). [current: 20]
|
|
121 |
|
|
122 |
.SH CLASSES
|
|
123 |
.IP "--ignore-iface-methods=<method names>"
|
|
124 |
List of interface methods to ignore, separated by a comma. This is used for instance to not check methods defines in Zope's Interface base class. [current: isImplementedBy,deferred,extends,names, namesAndDescriptions,queryDescriptionFor,getBases, getDescriptionFor,getDoc,getName,getTaggedValue, getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue, isImplementedByInstancesOf,adaptWith,is_implemented_by]
|
|
125 |
.IP "--defining-attr-methods=<method names>"
|
|
126 |
List of method names used to declare (i.e. assign) instance attributes. [current: __init__,__new__,setUp]
|
|
127 |
|
|
128 |
.SH IMPORTS
|
|
129 |
.IP "--deprecated-modules=<modules>"
|
|
130 |
Deprecated modules which should not be used, separated by a comma [current: regsub,string,TERMIOS,Bastion,rexec]
|
|
131 |
.IP "--import-graph=<file.dot>"
|
|
132 |
Create a graph of every (i.e. internal and external) dependencies in the given file (report R0402 must not be disabled) [current: none]
|
|
133 |
.IP "--ext-import-graph=<file.dot>"
|
|
134 |
Create a graph of external dependencies in the given file (report R0402 must not be disabled) [current: none]
|
|
135 |
.IP "--int-import-graph=<file.dot>"
|
|
136 |
Create a graph of internal dependencies in the given file (report R0402 must not be disabled) [current: none]
|
|
137 |
|
|
138 |
.SH FORMAT
|
|
139 |
.IP "--max-line-length=<int>"
|
|
140 |
Maximum number of characters on a single line. [current: 80]
|
|
141 |
.IP "--max-module-lines=<int>"
|
|
142 |
Maximum number of lines in a module [current: 1000]
|
|
143 |
.IP "--indent-string=<string>"
|
|
144 |
String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab). [current: ' ']
|
|
145 |
|
|
146 |
.SH SIMILARITIES
|
|
147 |
.IP "--min-similarity-lines=<int>"
|
|
148 |
Minimum lines number of a similarity. [current: 4]
|
|
149 |
.IP "--ignore-comments=<y or n>"
|
|
150 |
Ignore comments when computing similarities. [current: yes]
|
|
151 |
.IP "--ignore-docstrings=<y or n>"
|
|
152 |
Ignore docstrings when computing similarities. [current: yes]
|
|
153 |
|
|
154 |
.SH TYPECHECK
|
|
155 |
.IP "--ignore-mixin-members=<y_or_n>"
|
|
156 |
Tells wether missing members accessed in mixin class should be ignored. A mixin class is detected if its name ends with "mixin" (case insensitive). [current: yes]
|
|
157 |
.IP "--ignored-classes=<members names>"
|
|
158 |
List of classes names for which member attributes should not be checked (useful for classes with attributes dynamicaly set). [current: SQLObject]
|
|
159 |
.IP "--zope=<y_or_n>"
|
|
160 |
When zope mode is activated, add a predefined set of Zope acquired attributes to generated-members. [current: no]
|
|
161 |
.IP "--generated-members=<members names>"
|
|
162 |
List of members which are set dynamically and missed by pylint inference system, and so shouldn't trigger E0201 when accessed. [current: REQUEST,acl_users,aq_parent]
|
|
163 |
|
|
164 |
.SH VARIABLES
|
|
165 |
.IP "--init-import=<y_or_n>"
|
|
166 |
Tells wether we should check for unused import in __init__ files. [current: no]
|
|
167 |
.IP "--dummy-variables-rgx=<regexp>"
|
|
168 |
A regular expression matching names used for dummy variables (i.e. not used). [current: _|dummy]
|
|
169 |
.IP "--additional-builtins=<comma separated list>"
|
|
170 |
List of additional names supposed to be defined in builtins. Remember that you should avoid to define new builtins when possible. [current: none]
|
|
171 |
|
|
172 |
.SH MISCELLANEOUS
|
|
173 |
.IP "--notes=<comma separated values>"
|
|
174 |
List of note tags to take in consideration, separated by a comma. [current: FIXME,XXX,TODO]
|
|
175 |
|
|
176 |
.SH BASIC
|
|
177 |
.IP "--required-attributes=<attributes>"
|
|
178 |
Required attributes for module, separated by a comma [current: none]
|
|
179 |
.IP "--no-docstring-rgx=<regexp>"
|
|
180 |
Regular expression which should only match functions or classes name which do not require a docstring [current: __.*__]
|
|
181 |
.IP "--module-rgx=<regexp>"
|
|
182 |
Regular expression which should only match correct module names [current: (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$]
|
|
183 |
.IP "--const-rgx=<regexp>"
|
|
184 |
Regular expression which should only match correct module level names [current: (([A-Z_][A-Z0-9_]*)|(__.*__))$]
|
|
185 |
.IP "--class-rgx=<regexp>"
|
|
186 |
Regular expression which should only match correct class names [current: [A-Z_][a-zA-Z0-9]+$]
|
|
187 |
.IP "--function-rgx=<regexp>"
|
|
188 |
Regular expression which should only match correct function names [current: [a-z_][a-z0-9_]{2,30}$]
|
|
189 |
.IP "--method-rgx=<regexp>"
|
|
190 |
Regular expression which should only match correct method names [current: [a-z_][a-z0-9_]{2,30}$]
|
|
191 |
.IP "--attr-rgx=<regexp>"
|
|
192 |
Regular expression which should only match correct instance attribute names [current: [a-z_][a-z0-9_]{2,30}$]
|
|
193 |
.IP "--argument-rgx=<regexp>"
|
|
194 |
Regular expression which should only match correct argument names [current: [a-z_][a-z0-9_]{2,30}$]
|
|
195 |
.IP "--variable-rgx=<regexp>"
|
|
196 |
Regular expression which should only match correct variable names [current: [a-z_][a-z0-9_]{2,30}$]
|
|
197 |
.IP "--inlinevar-rgx=<regexp>"
|
|
198 |
Regular expression which should only match correct list comprehension / generator expression variable names [current: [A-Za-z_][A-Za-z0-9_]*$]
|
|
199 |
.IP "--good-names=<names>"
|
|
200 |
Good variable names which should always be accepted, separated by a comma [current: i,j,k,ex,Run,_]
|
|
201 |
.IP "--bad-names=<names>"
|
|
202 |
Bad variable names which should always be refused, separated by a comma [current: foo,bar,baz,toto,tutu,tata]
|
|
203 |
.IP "--bad-functions=<builtin function names>"
|
|
204 |
List of builtins function names that should not be used, separated by a comma [current: map,filter,apply,input]
|
|
205 |
|
|
206 |
.SH ENVIRONMENT VARIABLES
|
|
207 |
|
|
208 |
The following environment variables are used :
|
|
209 |
* PYLINTHOME
|
|
210 |
path to the directory where data of persistent run will be stored. If not
|
|
211 |
found, it defaults to ~/.pylint.d/ or .pylint.d (in the current working
|
|
212 |
directory) . The current PYLINTHOME is ~/.pylint.d.
|
|
213 |
* PYLINTRC
|
|
214 |
path to the configuration file. If not found, it will use the first
|
|
215 |
existant file in ~/.pylintrc, /etc/pylintrc. The current PYLINTRC is
|
|
216 |
None.
|
|
217 |
|
|
218 |
.SH OUTPUT
|
|
219 |
|
|
220 |
Using the default text output, the message format is :
|
|
221 |
MESSAGE_TYPE: LINE_NUM:[OBJECT:] MESSAGE
|
|
222 |
There are 5 kind of message types :
|
|
223 |
* (C) convention, for programming standard violation
|
|
224 |
* (R) refactor, for bad code smell
|
|
225 |
* (W) warning, for python specific problems
|
|
226 |
* (E) error, for probable bugs in the code
|
|
227 |
* (F) fatal, if an error occured which prevented pylint from doing further processing.
|
|
228 |
|
|
229 |
.SH SEE ALSO
|
|
230 |
/usr/share/doc/pylint/
|
|
231 |
|
|
232 |
.SH COPYRIGHT
|
|
233 |
Copyright (c) 2003-2008 Sylvain Thenault ([email protected]).
|
|
234 |
Copyright (c) 2003-2008 LOGILAB S.A. (Paris, FRANCE).
|
|
235 |
http://www.logilab.fr/ -- mailto:[email protected]
|
|
236 |
|
|
237 |
This program is free software; you can redistribute it and/or modify
|
|
238 |
it under the terms of the GNU General Public License as published
|
|
239 |
by the Free Software Foundation; either version 2 of the License,
|
|
240 |
or (at your option) any later version.
|
|
241 |
|
|
242 |
This program is distributed in the hope that it will be useful,
|
|
243 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
244 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
245 |
GNU General Public License for more details.
|
|
246 |
|
|
247 |
You should have received a copy of the GNU General Public License
|
|
248 |
along with this program; if not, write to the Free Software
|
|
249 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
250 |
MA 02111-1307 USA.
|
|
251 |
.SH BUGS
|
|
252 |
Please report bugs on the project's mailing list:
|
|
253 |
mailto://[email protected]
|
|
254 |
|
|
255 |
.SH AUTHOR
|
|
256 |
Sylvain Thenault <[email protected]>
|
|
257 |
|
|
258 |
.SH ATTRIBUTES
|
|
259 |
See
|
|
260 |
.BR attributes (5)
|
|
261 |
for descriptions of the following attributes:
|
|
262 |
.sp
|
|
263 |
.TS
|
|
264 |
box;
|
|
265 |
cbp-1 | cbp-1
|
|
266 |
l | l .
|
|
267 |
ATTRIBUTE TYPE ATTRIBUTE VALUE
|
|
268 |
=
|
11
|
269 |
Availability developer/python/pylint
|
0
|
270 |
=
|
|
271 |
Interface Stability Uncommitted
|
|
272 |
.TE
|
|
273 |
.SH NOTES
|
|
274 |
Documentation for pylint is available at http://www.logilab.org/project/pylint
|
|
275 |
|
|
276 |
Source for pylint is available on http://opensolaris.org.
|