~ubuntu-branches/ubuntu/trusty/pylint/trusty

« back to all changes in this revision

Viewing changes to man/pylint.1

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Thénault
  • Date: 2006-09-25 16:46:40 UTC
  • mfrom: (1.2.1 upstream) (2.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20060925164640-obkb6g34gqtyk20n
new uptream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH pylint 1 "2005-4-11" pylint
 
1
.TH pylint 1 "2006-9-25" pylint
2
2
.SH NAME
3
3
.B pylint 
4
4
\- python code static checker
33
33
show this help message and exit
34
34
 
35
35
.SH MASTER
36
 
lint Python modules using external checkers.                            
37
 
                                                                               
38
 
    This is the main checker controling the other ones and the reports         
39
 
    generation. It is itself both a raw checker and an astng checker in order  
40
 
    to:                                                                        
41
 
    * handle message activation / deactivation at the module level             
42
 
    * handle some basic but necessary stats'data (number of classes, methods...)
43
 
                                                                                
44
 
This checker also defines the following reports:                                    
45
 
  * R0001: Total errors / warnings                                              
46
 
  * R0002: % errors / warnings by module                                        
47
 
  * R0003: Messages                                                             
48
 
  * R0004: Global evaluation                                                    
49
 
 
50
36
.IP "--rcfile=<file>"
51
37
Specify a configuration file.
52
 
.IP "--zope"
53
 
Initialize Zope products before starting.
54
 
.IP "--disable-all"
55
 
Disable all possible checkers. This option should precede enable-* options.
 
38
.IP "--errors-only, -e"
 
39
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
 
40
.IP "--profile=<y_or_n>"
 
41
Profiled execution. [current: %default]
 
42
.IP "--ignore=<file>"
 
43
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: %default]
 
44
.IP "--persistent=<y_or_n>"
 
45
Pickle collected data for later comparisons. [current: %default]
 
46
.IP "--cache-size=<size>"
 
47
Set the cache size for astng objects. [current: %default]
 
48
.IP "--load-plugins=<modules>"
 
49
List of plugins (as comma separated values of python modules names) to load, usually to register additional checkers. [current: %default]
 
50
 
 
51
.SH COMMANDS
56
52
.IP "--help-msg=<msg-id>"
57
 
Display a help message for the given message id and exit. This option may be a comma separated list.
 
53
Display a help message for the given message id and exit. The value may be a comma separated list of message ids.
58
54
.IP "--list-msgs"
59
 
List and explain every available messages.
 
55
Generate pylint's full documentation.
60
56
.IP "--generate-rcfile"
61
 
Generate a sample configuration file according to the current configuration. You can put other options before this one to use them in the configuration. This option causes the program to exit
 
57
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.
62
58
.IP "--generate-man"
63
 
Generate a man page for pylint. This option causes the program to exit
64
 
.IP "--profile"
65
 
Profiled execution.
66
 
.IP "--ignore=<file>"
67
 
Add <file or directory> to the black list. It should be a base name, not a path. You may set this option multiple times.
68
 
.IP "--persistent=<y_or_n>"
69
 
Pickle collected data for later comparisons.
70
 
.IP "--cache-size=<size>"
71
 
Set the cache size for astng objects.
 
59
Generate pylint's man page.
72
60
 
73
 
.SH REPORTS
74
 
Options related to messages / statistics reporting
75
 
.IP "--reports=<y_or_n>"
76
 
Tells wether to display a full report or only the messages
77
 
.IP "--html=<y_or_n>"
78
 
Use HTML as output format instead of text
79
 
.IP "--parseable=<y_or_n>"
80
 
Use a parseable text output format, so your favorite text editor will be able to jump to the line corresponding to a message.
81
 
.IP "--color=<y_or_n>"
82
 
Colorizes text output using ansi escape codes
83
 
.IP "--files-output=<y_or_n>"
84
 
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]".
85
 
.IP "--evaluation=<python_expression>"
86
 
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).
87
 
.IP "--comment=<y_or_n>"
88
 
Add a comment according to your evaluation note. This is used by the global evaluation report (R0004).
89
 
.IP "--include-ids=<y_or_n>"
90
 
Include message's id in output
 
61
.SH MESSAGES CONTROL
 
62
.IP "--enable-checker=<checker ids>"
 
63
Enable only checker(s) with the given id(s).                 This option conflict with the disable-checker option
 
64
.IP "--disable-checker=<checker ids>"
 
65
Enable all checker(s) except those with the                  given id(s).                 This option conflict with the disable-checker option
91
66
.IP "--enable-msg-cat=<msg cats>"
92
67
Enable all messages in the listed categories.
93
68
.IP "--disable-msg-cat=<msg cats>"
94
69
Disable all messages in the listed categories.
95
70
.IP "--enable-msg=<msg ids>"
96
 
Enable the message with the given id.
 
71
Enable the message(s) with the given id(s).
97
72
.IP "--disable-msg=<msg ids>"
98
 
Disable the message with the given id.
 
73
Disable the message(s) with the given id(s).
 
74
 
 
75
.SH REPORTS
 
76
.IP "--output-format=<format>, -f <format>"
 
77
set the output format. Available formats are text,                 parseable, colorized and html [current: %default]
 
78
.IP "--include-ids=<y_or_n>, -i <y_or_n>"
 
79
Include message's id in output [current: %default]
 
80
.IP "--files-output=<y_or_n>"
 
81
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: %default]
 
82
.IP "--reports=<y_or_n>, -r <y_or_n>"
 
83
Tells wether to display a full report or only the messages [current: %default]
 
84
.IP "--evaluation=<python_expression>"
 
85
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: %default]
 
86
.IP "--comment=<y_or_n>"
 
87
Add a comment according to your evaluation note. This is used by the global evaluation report (R0004). [current: %default]
99
88
.IP "--enable-report=<rpt ids>"
100
 
Enable the report with the given id.
 
89
Enable the report(s) with the given id(s).
101
90
.IP "--disable-report=<rpt ids>"
102
 
Disable the report with the given id.
103
 
 
104
 
.SH VARIABLES
105
 
checks for                                                              
106
 
    * unused variables / imports                                               
107
 
    * undefined variables                                                      
108
 
    * redefinition of variable from builtins or from an outer scope            
109
 
    * use of variable before assigment                                         
110
 
    
111
 
.IP "--enable-variables=<y_or_n>"
112
 
Enable / disable this checker
113
 
.IP "--init-import=<y_or_n>"
114
 
Tells wether we should check for unused import in __init__ files.
115
 
.IP "--dummy-variables=<comma separated list>"
116
 
List of variable names used for dummy variables (i.e. not used).
 
91
Disable the report(s) with the given id(s).
 
92
 
 
93
.SH BASIC
 
94
.IP "--required-attributes=<attributes>"
 
95
Required attributes for module, separated by a comma [current: %default]
 
96
.IP "--no-docstring-rgx=<regexp>"
 
97
Regular expression which should only match functions or classes name which do not require a docstring [current: %default]
 
98
.IP "--module-rgx=<regexp>"
 
99
Regular expression which should only match correct module names [current: %default]
 
100
.IP "--const-rgx=<regexp>"
 
101
Regular expression which should only match correct module level names [current: %default]
 
102
.IP "--class-rgx=<regexp>"
 
103
Regular expression which should only match correct class names [current: %default]
 
104
.IP "--function-rgx=<regexp>"
 
105
Regular expression which should only match correct function names [current: %default]
 
106
.IP "--method-rgx=<regexp>"
 
107
Regular expression which should only match correct method names [current: %default]
 
108
.IP "--attr-rgx=<regexp>"
 
109
Regular expression which should only match correct instance attribute names [current: %default]
 
110
.IP "--argument-rgx=<regexp>"
 
111
Regular expression which should only match correct argument names [current: %default]
 
112
.IP "--variable-rgx=<regexp>"
 
113
Regular expression which should only match correct variable names [current: %default]
 
114
.IP "--inlinevar-rgx=<regexp>"
 
115
Regular expression which should only match correct list comprehension / generator expression variable                           names [current: %default]
 
116
.IP "--good-names=<names>"
 
117
Good variable names which should always be accepted, separated by a comma [current: %default]
 
118
.IP "--bad-names=<names>"
 
119
Bad variable names which should always be refused, separated by a comma [current: %default]
 
120
.IP "--bad-functions=<builtin function names>"
 
121
List of builtins function names that should not be used, separated by a comma [current: %default]
 
122
 
 
123
.SH CLASSES
 
124
.IP "--ignore-iface-methods=<method names>"
 
125
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: %default]
 
126
.IP "--defining-attr-methods=<method names>"
 
127
List of method names used to declare (i.e. assign) instance attributes. [current: %default]
117
128
 
118
129
.SH DESIGN
119
 
checks for sign of poor/misdesign:                                      
120
 
    * number of methods, attributes, local variables...                        
121
 
    * size, complexity of functions, methods                                   
122
 
    
123
 
.IP "--enable-design=<y_or_n>"
124
 
Enable / disable this checker
125
130
.IP "--max-args=<int>"
126
 
Maximum number of arguments for function / method
 
131
Maximum number of arguments for function / method [current: %default]
127
132
.IP "--max-locals=<int>"
128
 
Maximum number of locals for function / method body
 
133
Maximum number of locals for function / method body [current: %default]
129
134
.IP "--max-returns=<int>"
130
 
Maximum number of return / yield for function / method body
 
135
Maximum number of return / yield for function / method body [current: %default]
131
136
.IP "--max-branchs=<int>"
132
 
Maximum number of branch for function / method body
 
137
Maximum number of branch for function / method body [current: %default]
133
138
.IP "--max-statements=<int>"
134
 
Maximum number of statements in function / method body
 
139
Maximum number of statements in function / method body [current: %default]
135
140
.IP "--max-parents=<num>"
136
 
Maximum number of parents for a class (see R0901).
 
141
Maximum number of parents for a class (see R0901). [current: %default]
137
142
.IP "--max-attributes=<num>"
138
 
Maximum number of attributes for a class (see R0902).
 
143
Maximum number of attributes for a class (see R0902). [current: %default]
139
144
.IP "--min-public-methods=<num>"
140
 
Minimum number of public methods for a class (see R0903).
 
145
Minimum number of public methods for a class (see R0903). [current: %default]
141
146
.IP "--max-public-methods=<num>"
142
 
Maximum number of public methods for a class (see R0904).
143
 
 
144
 
.SH EXCEPTIONS
145
 
checks for                                                              
146
 
    * excepts without exception filter                                         
147
 
    * string exceptions                                                        
148
 
    
149
 
.IP "--enable-exceptions=<y_or_n>"
150
 
Enable / disable this checker
151
 
 
152
 
.SH METRICS
153
 
does not check anything but gives some raw metrics :                    
154
 
    * total number of lines                                                    
155
 
    * total number of code lines                                               
156
 
    * total number of docstring lines                                          
157
 
    * total number of comments lines                                           
158
 
    * total number of empty lines                                              
159
 
                                                                                
160
 
This checker also defines the following reports:                                    
161
 
  * R0701: Raw metrics                                                          
162
 
 
163
 
.IP "--enable-metrics=<y_or_n>"
164
 
Enable / disable this checker
165
 
 
166
 
.SH SIMILARITIES
167
 
checks for similarities and duplicated code. This computation may be
168
 
    memory / CPU intensive, so you should disable it if you experiments some
169
 
    problems.
170
 
                                                                                
171
 
This checker also defines the following reports:                                    
172
 
  * R0801: Duplication                                                          
173
 
 
174
 
.IP "--enable-similarities=<y_or_n>"
175
 
Enable / disable this checker
176
 
.IP "--min-similarity-lines=<int>"
177
 
Minimum lines number of a similarity.
178
 
.IP "--ignore-comments=<y or n>"
179
 
Ignore comments when computing similarities.
180
 
 
181
 
.SH MISCELLANEOUS
182
 
checks for:                                                             
183
 
    * warning notes in the code like FIXME, XXX                                
184
 
    * PEP 263: source code with non ascii character but no encoding declaration
185
 
    
186
 
.IP "--enable-miscellaneous=<y_or_n>"
187
 
Enable / disable this checker
188
 
.IP "--notes=<comma separated values>"
189
 
List of note tags to take in consideration, separated by a comma. Default to FIXME, XXX, TODO
 
147
Maximum number of public methods for a class (see R0904). [current: %default]
 
148
 
 
149
.SH FORMAT
 
150
.IP "--max-line-length=<int>"
 
151
Maximum number of characters on a single line. [current: %default]
 
152
.IP "--max-module-lines=<int>"
 
153
Maximum number of lines in a module [current: %default]
 
154
.IP "--indent-string=<string>"
 
155
String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1 tab). [current: %default]
190
156
 
191
157
.SH IMPORTS
192
 
checks for                                                              
193
 
    * external modules dependencies                                            
194
 
    * relative / wildcard imports                                                         
195
 
    * cyclic imports                                                           
196
 
    * uses of deprecated modules
197
 
                                                                                
198
 
This checker also defines the following reports:                                    
199
 
  * R0401: External dependencies                                                
200
 
  * R0402: Modules dependencies graph                                           
201
 
 
202
 
.IP "--enable-imports=<y_or_n>"
203
 
Enable / disable this checker
204
158
.IP "--deprecated-modules=<modules>"
205
 
Deprecated modules which should not be used, separated by a comma
 
159
Deprecated modules which should not be used, separated by a comma [current: %default]
206
160
.IP "--import-graph=<file.dot>"
207
 
Create a graph of every (i.e. internal and external) dependencies in the given file (report R0402 must not be disabled)
 
161
Create a graph of every (i.e. internal and external) dependencies in the given file (report R0402 must not be disabled) [current: %default]
208
162
.IP "--ext-import-graph=<file.dot>"
209
 
Create a graph of external dependencies in the given file (report R0402 must not be disabled)
 
163
Create a graph of external dependencies in the given file (report R0402 must not be disabled) [current: %default]
210
164
.IP "--int-import-graph=<file.dot>"
211
 
Create a graph of internal dependencies in the given file (report R0402 must not be disabled)
212
 
 
213
 
.SH FORMAT
214
 
checks for :                                                            
215
 
    * unauthorized constructions                                               
216
 
    * strict indentation                                                       
217
 
    * line length                                                              
218
 
    * use of <> instead of !=
219
 
    
220
 
.IP "--enable-format=<y_or_n>"
221
 
Enable / disable this checker
222
 
.IP "--max-line-length=<int>"
223
 
Maximum number of characters on a single line.
224
 
.IP "--max-module-lines=<int>"
225
 
Maximum number of lines in a module
226
 
.IP "--indent-string=<string>"
227
 
String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1 tab).
228
 
 
229
 
.SH BASIC
230
 
checks for :                                                            
231
 
    * doc strings                                                              
232
 
    * modules / classes / functions / methods / arguments / variables name     
233
 
    * number of arguments, local variables, branchs, returns and statements in
234
 
functions, methods                                                       
235
 
    * required module attributes                                             
236
 
    * dangerous default values as arguments                                    
237
 
    * redefinition of function / method / class                                
238
 
    * uses of the global statement                                             
239
 
                                                                                
240
 
This checker also defines the following reports:                                    
241
 
  * R0101: Statistics by type                                                   
242
 
 
243
 
.IP "--enable-basic=<y_or_n>"
244
 
Enable / disable this checker
245
 
.IP "--required-attributes=<attributes>"
246
 
Required attributes for module, separated by a comma
247
 
.IP "--no-docstring-rgx=<regexp>"
248
 
Regular expression which should only match functions or classes name which do not require a docstring
249
 
.IP "--min-name-length=<int>"
250
 
Minimal length for module / class / function / method / argument / variable names
251
 
.IP "--module-rgx=<regexp>"
252
 
Regular expression which should only match correct module names
253
 
.IP "--class-rgx=<regexp>"
254
 
Regular expression which should only match correct class names
255
 
.IP "--function-rgx=<regexp>"
256
 
Regular expression which should only match correct function names
257
 
.IP "--method-rgx=<regexp>"
258
 
Regular expression which should only match correct method names
259
 
.IP "--argument-rgx=<regexp>"
260
 
Regular expression which should only match correct argument names
261
 
.IP "--variable-rgx=<regexp>"
262
 
Regular expression which should only match correct variable names
263
 
.IP "--good-names=<names>"
264
 
Good variable names which should always be accepted, separated by a comma
265
 
.IP "--bad-names=<names>"
266
 
Bad variable names which should always be refused, separated by a comma
267
 
.IP "--bad-functions=<builtin function names>"
268
 
List of builtins function names that should not be used, separated by a comma
269
 
 
270
 
.SH CLASSES
271
 
checks for :                                                            
272
 
    * methods without self as first argument                                   
273
 
    * overriden methods signature                                              
274
 
    * access only to existant members via self                                 
275
 
    * attributes not defined in the __init__ method                            
276
 
    * supported interfaces implementation                                      
277
 
    * unreachable code                                                         
278
 
    
279
 
.IP "--enable-classes=<y_or_n>"
280
 
Enable / disable this checker
281
 
.IP "--ignore-iface-methods=<method names>"
282
 
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.
 
165
Create a graph of internal dependencies in the given file (report R0402 must not be disabled) [current: %default]
 
166
 
 
167
.SH MISCELLANEOUS
 
168
.IP "--notes=<comma separated values>"
 
169
List of note tags to take in consideration, separated by a comma. [current: %default]
 
170
 
 
171
.SH SIMILARITIES
 
172
.IP "--min-similarity-lines=<int>"
 
173
Minimum lines number of a similarity. [current: %default]
 
174
.IP "--ignore-comments=<y or n>"
 
175
Ignore comments when computing similarities. [current: %default]
 
176
.IP "--ignore-docstrings=<y or n>"
 
177
Ignore docstrings when computing similarities. [current: %default]
 
178
 
 
179
.SH TYPECHECK
283
180
.IP "--ignore-mixin-members=<y_or_n>"
284
 
Tells wether missing members accessed in mixin class should be ignored. A mixin class is detected if its name ends with "mixin" (case insensitive).
 
181
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: %default]
 
182
.IP "--zope=<y_or_n>"
 
183
When zope mode is activated, consider the acquired-members option to ignore access to some undefined attributes. [current: %default]
 
184
.IP "--acquired-members=<members names>"
 
185
List of members which are usually get through zope's acquisition mecanism and so shouldn't trigger E0201 when accessed (need zope=yes to be considered). [current: %default]
 
186
 
 
187
.SH VARIABLES
 
188
.IP "--init-import=<y_or_n>"
 
189
Tells wether we should check for unused import in __init__ files. [current: %default]
 
190
.IP "--dummy-variables-rgx=<regexp>"
 
191
A regular expression matching names used                  for dummy variables (i.e. not used). [current: %default]
 
192
.IP "--additional-builtins=<comma separated list>"
 
193
List of additional names supposed to be defined in builtins. Remember that you should avoid to define new builtins when possible. [current: %default]
285
194
 
286
195
.SH ENVIRONMENT VARIABLES
287
196
 
295
204
existant file in ~/.pylintrc, /etc/pylintrc. The current PYLINTRC is
296
205
None.                                                                 
297
206
 
298
 
 
299
207
.SH OUTPUT
300
208
 
301
209
Using the default text output, the message format is :                         
304
212
    * (C) convention, for programming standard violation                       
305
213
    * (R) refactor, for bad code smell                                         
306
214
    * (W) warning, for python specific problems                                
307
 
    * (E) error, for much probably bugs in the code                                                
 
215
    * (E) error, for much probably bugs in the code
308
216
    * (F) fatal, if an error occured which prevented pylint from doing further processing.     
309
217
        
310
 
 
311
218
.SH SEE ALSO
312
219
/usr/share/doc/pythonX.Y-pylint/
313
220
 
314
221
.SH COPYRIGHT 
315
 
Copyright (c) 2003-2005 Sylvain Thenault (thenault@gmail.com).
316
 
Copyright (c) 2003-2005 LOGILAB S.A. (Paris, FRANCE).
 
222
Copyright (c) 2003-2006 Sylvain Thenault (thenault@gmail.com).
 
223
Copyright (c) 2003-2006 LOGILAB S.A. (Paris, FRANCE).
317
224
http://www.logilab.fr/ -- mailto:contact@logilab.fr
318
225
 
319
226
This program is free software; you can redistribute it and/or modify