blob: 72dccd7da6ed244977d885d84e3a7f459ae2df00 [file] [log] [blame]
David Pursehouse4f7bdea2012-10-22 12:50:15 +09001# 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# 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=SVN
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.
47#enable-msg-cat=
48
49# Disable all messages in the listed categories.
50#disable-msg-cat=
51
52# Enable the message(s) with the given id(s).
53enable=RP0004
54
55# Disable the message(s) with the given id(s).
David Pursehousec1b86a22012-11-14 11:36:51 +090056disable=R0903,R0912,R0913,R0914,R0915,W0141,C0111,C0103,C0323,C0322,C0324,W0603,W0703,R0911,C0301,C0302,R0902,R0904,W0142,W0212,E1101,E1103,R0201,W0201,W0122,W0232,RP0001,RP0003,RP0101,RP0002,RP0401,RP0701,RP0801
David Pursehouse4f7bdea2012-10-22 12:50:15 +090057
58[REPORTS]
59
60# set the output format. Available formats are text, parseable, colorized, msvs
61# (visual studio) and html
62output-format=text
63
64# Include message's id in output
65include-ids=yes
66
67# Put messages in a separate file for each module / package specified on the
68# command line instead of printing them on stdout. Reports (if any) will be
69# written in a file name "pylint_global.[txt|html]".
70files-output=no
71
72# Tells whether to display a full report or only the messages
73reports=yes
74
75# Python expression which should return a note less than 10 (10 is the highest
76# note).You have access to the variables errors warning, statement which
77# respectivly contain the number of errors / warnings messages and the total
78# number of statements analyzed. This is used by the global evaluation report
79# (R0004).
80evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
81
82# Add a comment according to your evaluation note. This is used by the global
83# evaluation report (R0004).
84comment=no
85
86# checks for
87# * unused variables / imports
88# * undefined variables
89# * redefinition of variable from builtins or from an outer scope
90# * use of variable before assigment
91#
92[VARIABLES]
93
94# Tells whether we should check for unused import in __init__ files.
95init-import=no
96
97# A regular expression matching names used for dummy variables (i.e. not used).
98dummy-variables-rgx=_|dummy
99
100# List of additional names supposed to be defined in builtins. Remember that
101# you should avoid to define new builtins when possible.
102additional-builtins=
103
104
105# try to find bugs in the code using type inference
106#
107[TYPECHECK]
108
109# Tells whether missing members accessed in mixin class should be ignored. A
110# mixin class is detected if its name ends with "mixin" (case insensitive).
111ignore-mixin-members=yes
112
113# List of classes names for which member attributes should not be checked
114# (useful for classes with attributes dynamicaly set).
115ignored-classes=SQLObject
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=_main|__.*__
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_]*)|(__.*__))|(log)$
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_]{2,30}$
156
157# Regular expression which should only match correct method names
158method-rgx=[a-z_][a-z0-9_]{2,30}$
159
160# Regular expression which should only match correct instance attribute names
161attr-rgx=[a-z_][a-z0-9_]{2,30}$
162
163# Regular expression which should only match correct argument names
164argument-rgx=[a-z_][a-z0-9_]{2,30}$
165
166# Regular expression which should only match correct variable names
167variable-rgx=[a-z_][a-z0-9_]{2,30}$
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,_,e,d1,d2,v,f,l,d
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=map,filter,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=5
191
192# Maximum number of locals for function / method body
193max-locals=15
194
195# Maximum number of return / yield for function / method body
196max-returns=6
197
198# Maximum number of branch for function / method body
199max-branchs=12
200
201# Maximum number of statements in function / method body
202max-statements=50
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=2
212
213# Maximum number of public methods for a class (see R0904).
214max-public-methods=30
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=4
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=80
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). In repo it is 2 spaces.
301indent-string=' '