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