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