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

« back to all changes in this revision

Viewing changes to examples/pylintrc

  • 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
 
# lint Python modules using external checkers.                            
2
 
#                                                                                
3
 
#     This is the main checker controling the other ones and the reports         
4
 
#     generation. It is itself both a raw checker and an astng checker in order  
5
 
#     to:                                                                        
6
 
#     * handle message activation / deactivation at the module level             
7
 
#     * handle some basic but necessary stats'data (number of classes, methods...)
8
 
#                                                                                 
9
 
# This checker also defines the following reports:                                    
10
 
#   * R0001: Total errors / warnings                                              
11
 
#   * R0002: % errors / warnings by module                                        
12
 
#   * R0003: Messages                                                             
13
 
#   * R0004: Global evaluation                                                    
 
1
# lint Python modules using external checkers.
 
2
 
3
# This is the main checker controling the other ones and the reports
 
4
# generation. It is itself both a raw checker and an astng checker in order
 
5
# to:
 
6
# * handle message activation / deactivation at the module level
 
7
# * handle some basic but necessary stats'data (number of classes, methods...)
14
8
15
9
[MASTER]
 
10
 
 
11
# Profiled execution.
 
12
profile=no
 
13
 
16
14
# Add <file or directory> to the black list. It should be a base name, not a
17
15
# path. You may set this option multiple times.
18
16
ignore=CVS
23
21
# Set the cache size for astng objects.
24
22
cache-size=500
25
23
 
 
24
# List of plugins (as comma separated values of python modules names) to load,
 
25
# usually to register additional checkers.
 
26
load-plugins=
 
27
 
 
28
 
 
29
 
 
30
 
26
31
 
27
32
 
28
33
[REPORTS]
29
 
# Tells wether to display a full report or only the messages
30
 
reports=yes
31
 
 
32
 
# Use HTML as output format instead of text
33
 
html=no
34
 
 
35
 
# Use a parseable text output format, so your favorite text editor will be able
36
 
# to jump to the line corresponding to a message.
37
 
parseable=no
38
 
 
39
 
# Colorizes text output using ansi escape codes
40
 
color=no
 
34
 
 
35
# set the output format. Available formats are text, parseable, colorized and
 
36
# html
 
37
output-format=text
 
38
 
 
39
# Include message's id in output
 
40
include-ids=no
41
41
 
42
42
# Put messages in a separate file for each module / package specified on the
43
43
# command line instead of printing them on stdout. Reports (if any) will be
44
44
# written in a file name "pylint_global.[txt|html]".
45
45
files-output=no
46
46
 
 
47
# Tells wether to display a full report or only the messages
 
48
reports=yes
 
49
 
47
50
# Python expression which should return a note less than 10 (10 is the highest
48
51
# note).You have access to the variables errors warning, statement which
49
52
# respectivly contain the number of errors / warnings messages and the total
55
58
# evaluation report (R0004).
56
59
comment=no
57
60
 
58
 
# Include message's id in output
59
 
include-ids=no
60
 
 
61
 
 
62
 
 
63
 
# checks for                                                              
64
 
#     * unused variables / imports                                               
65
 
#     * undefined variables                                                      
66
 
#     * redefinition of variable from builtins or from an outer scope            
67
 
#     * use of variable before assigment                                         
68
 
#     
69
 
[VARIABLES]
70
 
# Enable / disable this checker
71
 
enable-variables=yes
72
 
 
73
 
# Tells wether we should check for unused import in __init__ files.
74
 
init-import=no
75
 
 
76
 
# List of variable names used for dummy variables (i.e. not used).
77
 
dummy-variables=_,dummy
78
 
 
79
 
 
80
 
 
81
 
# checks for :                                                            
82
 
#     * doc strings                                                              
83
 
#     * modules / classes / functions / methods / arguments / variables name     
84
 
#     * number of arguments, local variables, branchs, returns and statements in
85
 
# functions, methods                                                       
86
 
#     * required module attributes                                             
87
 
#     * dangerous default values as arguments                                    
88
 
#     * redefinition of function / method / class                                
89
 
#     * uses of the global statement                                             
90
 
#                                                                                 
91
 
# This checker also defines the following reports:                                    
92
 
#   * R0101: Statistics by type                                                   
 
61
 
 
62
# checks for :
 
63
# * doc strings
 
64
# * modules / classes / functions / methods / arguments / variables name
 
65
# * number of arguments, local variables, branchs, returns and statements in
 
66
# functions, methods
 
67
# * required module attributes
 
68
# * dangerous default values as arguments
 
69
# * redefinition of function / method / class
 
70
# * uses of the global statement
93
71
94
72
[BASIC]
95
 
# Enable / disable this checker
96
 
enable-basic=yes
97
73
 
98
74
# Required attributes for module, separated by a comma
99
 
required-attributes=__revision__
 
75
required-attributes=
100
76
 
101
77
# Regular expression which should only match functions or classes name which do
102
78
# not require a docstring
103
79
no-docstring-rgx=__.*__
104
80
 
105
 
# Minimal length for module / class / function / method / argument / variable
106
 
# names
107
 
min-name-length=3
108
 
 
109
81
# Regular expression which should only match correct module names
110
82
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
111
83
 
 
84
# Regular expression which should only match correct module level names
 
85
const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
 
86
 
112
87
# Regular expression which should only match correct class names
113
88
class-rgx=[A-Z_][a-zA-Z0-9]+$
114
89
 
115
90
# Regular expression which should only match correct function names
116
 
function-rgx=[a-z_][a-z0-9_]*$
 
91
function-rgx=[a-z_][a-z0-9_]{2,30}$
117
92
 
118
93
# Regular expression which should only match correct method names
119
 
method-rgx=[a-z_][a-z0-9_]*$
 
94
method-rgx=[a-z_][a-z0-9_]{2,30}$
 
95
 
 
96
# Regular expression which should only match correct instance attribute names
 
97
attr-rgx=[a-z_][a-z0-9_]{2,30}$
120
98
 
121
99
# Regular expression which should only match correct argument names
122
 
argument-rgx=[a-z_][a-z0-9_]*$
 
100
argument-rgx=[a-z_][a-z0-9_]{2,30}$
123
101
 
124
102
# Regular expression which should only match correct variable names
125
 
variable-rgx=[a-z_][a-z0-9_]*$
 
103
variable-rgx=[a-z_][a-z0-9_]{2,30}$
 
104
 
 
105
# Regular expression which should only match correct list comprehension /
 
106
# generator expression variable names
 
107
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
126
108
 
127
109
# Good variable names which should always be accepted, separated by a comma
128
110
good-names=i,j,k,ex,Run,_
134
116
bad-functions=map,filter,apply,input
135
117
 
136
118
 
137
 
 
138
 
# checks for sign of poor/misdesign:                                      
139
 
#     * number of methods, attributes, local variables...                        
140
 
#     * size, complexity of functions, methods                                   
141
 
#     
 
119
# try to find bugs in the code using type inference
 
120
 
121
[TYPECHECK]
 
122
 
 
123
# Tells wether missing members accessed in mixin class should be ignored. A
 
124
# mixin class is detected if its name ends with "mixin" (case insensitive).
 
125
ignore-mixin-members=yes
 
126
 
 
127
# When zope mode is activated, consider the acquired-members option to ignore
 
128
# access to some undefined attributes.
 
129
zope=no
 
130
 
 
131
# List of members which are usually get through zope's acquisition mecanism and
 
132
# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
 
133
acquired-members=REQUEST,acl_users,aq_parent
 
134
 
 
135
 
 
136
# checks for
 
137
# * unused variables / imports
 
138
# * undefined variables
 
139
# * redefinition of variable from builtins or from an outer scope
 
140
# * use of variable before assigment
 
141
 
142
[VARIABLES]
 
143
 
 
144
# Tells wether we should check for unused import in __init__ files.
 
145
init-import=no
 
146
 
 
147
# A regular expression matching names used for dummy variables (i.e. not used).
 
148
dummy-variables-rgx=_|dummy
 
149
 
 
150
# List of additional names supposed to be defined in builtins. Remember that
 
151
# you should avoid to define new builtins when possible.
 
152
additional-builtins=
 
153
 
 
154
 
 
155
# checks for :
 
156
# * methods without self as first argument
 
157
# * overridden methods signature
 
158
# * access only to existant members via self
 
159
# * attributes not defined in the __init__ method
 
160
# * supported interfaces implementation
 
161
# * unreachable code
 
162
 
163
[CLASSES]
 
164
 
 
165
# List of interface methods to ignore, separated by a comma. This is used for
 
166
# instance to not check methods defines in Zope's Interface base class.
 
167
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
 
168
 
 
169
# List of method names used to declare (i.e. assign) instance attributes.
 
170
defining-attr-methods=__init__,__new__,setUp
 
171
 
 
172
 
 
173
# checks for sign of poor/misdesign:
 
174
# * number of methods, attributes, local variables...
 
175
# * size, complexity of functions, methods
 
176
142
177
[DESIGN]
143
 
# Enable / disable this checker
144
 
enable-design=yes
145
178
 
146
179
# Maximum number of arguments for function / method
147
180
max-args=5
171
204
max-public-methods=20
172
205
 
173
206
 
174
 
 
175
 
# checks for                                                              
176
 
#     * external modules dependencies                                            
177
 
#     * relative / wildcard imports                                                         
178
 
#     * cyclic imports                                                           
179
 
#     * uses of deprecated modules
180
 
#                                                                                 
181
 
# This checker also defines the following reports:                                    
182
 
#   * R0401: External dependencies                                                
183
 
#   * R0402: Modules dependencies graph                                           
 
207
# checks for
 
208
# * external modules dependencies
 
209
# * relative / wildcard imports
 
210
# * cyclic imports
 
211
# * uses of deprecated modules
184
212
185
213
[IMPORTS]
186
 
# Enable / disable this checker
187
 
enable-imports=yes
188
214
 
189
215
# Deprecated modules which should not be used, separated by a comma
190
216
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
191
217
 
192
 
# Create a graph of every (i.e. internal and external) dependencies in the given
193
 
# file (report R0402 must not be disabled)
 
218
# Create a graph of every (i.e. internal and external) dependencies in the
 
219
# given file (report R0402 must not be disabled)
194
220
import-graph=
195
221
 
196
222
# Create a graph of external dependencies in the given file (report R0402 must
202
228
int-import-graph=
203
229
 
204
230
 
205
 
 
206
 
# checks for :                                                            
207
 
#     * methods without self as first argument                                   
208
 
#     * overriden methods signature                                              
209
 
#     * access only to existant members via self                                 
210
 
#     * attributes not defined in the __init__ method                            
211
 
#     * supported interfaces implementation                                      
212
 
#     * unreachable code                                                         
213
 
#     
214
 
[CLASSES]
215
 
# Enable / disable this checker
216
 
enable-classes=yes
217
 
 
218
 
# List of interface methods to ignore, separated by a comma. This is used for
219
 
# instance to not check methods defines in Zope's Interface base class.
220
 
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
221
 
 
222
 
# Tells wether missing members accessed in mixin class should be ignored. A
223
 
# mixin class is detected if its name ends with "mixin" (case insensitive).
224
 
ignore-mixin-members=yes
225
 
 
226
 
 
227
 
 
228
 
# checks for                                                              
229
 
#     * excepts without exception filter                                         
230
 
#     * string exceptions                                                        
231
 
#     
232
 
[EXCEPTIONS]
233
 
# Enable / disable this checker
234
 
enable-exceptions=yes
235
 
 
236
 
 
237
 
 
238
 
# does not check anything but gives some raw metrics :                    
239
 
#     * total number of lines                                                    
240
 
#     * total number of code lines                                               
241
 
#     * total number of docstring lines                                          
242
 
#     * total number of comments lines                                           
243
 
#     * total number of empty lines                                              
244
 
#                                                                                 
245
 
# This checker also defines the following reports:                                    
246
 
#   * R0701: Raw metrics                                                          
247
 
248
 
[METRICS]
249
 
# Enable / disable this checker
250
 
enable-metrics=yes
251
 
 
 
231
# checks for :
 
232
# * unauthorized constructions
 
233
# * strict indentation
 
234
# * line length
 
235
# * use of <> instead of !=
 
236
 
237
[FORMAT]
 
238
 
 
239
# Maximum number of characters on a single line.
 
240
max-line-length=80
 
241
 
 
242
# Maximum number of lines in a module
 
243
max-module-lines=1000
 
244
 
 
245
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
 
246
# tab).
 
247
indent-string='    '
 
248
 
 
249
 
 
250
# checks for:
 
251
# * warning notes in the code like FIXME, XXX
 
252
# * PEP 263: source code with non ascii character but no encoding declaration
 
253
 
254
[MISCELLANEOUS]
 
255
 
 
256
# List of note tags to take in consideration, separated by a comma.
 
257
notes=FIXME,XXX,TODO
252
258
 
253
259
 
254
260
# checks for similarities and duplicated code. This computation may be
255
 
#     memory / CPU intensive, so you should disable it if you experiments some
256
 
#     problems.
257
 
#                                                                                 
258
 
# This checker also defines the following reports:                                    
259
 
#   * R0801: Duplication                                                          
 
261
# memory / CPU intensive, so you should disable it if you experiments some
 
262
# problems.
260
263
261
264
[SIMILARITIES]
262
 
# Enable / disable this checker
263
 
enable-similarities=yes
264
265
 
265
266
# Minimum lines number of a similarity.
266
267
min-similarity-lines=4
268
269
# Ignore comments when computing similarities.
269
270
ignore-comments=yes
270
271
 
271
 
 
272
 
 
273
 
# checks for:                                                             
274
 
#     * warning notes in the code like FIXME, XXX                                
275
 
#     * PEP 263: source code with non ascii character but no encoding declaration
276
 
#     
277
 
[MISCELLANEOUS]
278
 
# Enable / disable this checker
279
 
enable-miscellaneous=yes
280
 
 
281
 
# List of note tags to take in consideration, separated by a comma. Default to
282
 
# FIXME, XXX, TODO
283
 
notes=FIXME,XXX,TODO
284
 
 
285
 
 
286
 
 
287
 
# checks for :                                                            
288
 
#     * unauthorized constructions                                               
289
 
#     * strict indentation                                                       
290
 
#     * line length                                                              
291
 
#     * use of <> instead of !=
292
 
#     
293
 
[FORMAT]
294
 
# Enable / disable this checker
295
 
enable-format=yes
296
 
 
297
 
# Maximum number of characters on a single line.
298
 
max-line-length=80
299
 
 
300
 
# Maximum number of lines in a module
301
 
max-module-lines=1000
302
 
 
303
 
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
304
 
indent-string='    '
305
 
 
306
 
 
307
 
 
 
272
# Ignore docstrings when computing similarities.
 
273
ignore-docstrings=yes