blob: 1540a5187ca5b8f4570492584fc0d75ecb1689f9 [file] [log] [blame]
Craig Citro4572ff02015-05-01 09:14:07 -07001# PyLint config for apitools code.
2#
3# NOTES:
4#
5# - Rules for test / demo code are generated into 'pylintrc_reduced'
6# as deltas from this configuration by the 'run_pylint.py' script.
7#
8# - 'RATIONALE: API mapping' as a defense for non-default settings is
9# based on the fact that this library maps APIs which are outside our
10# control, and adhering to the out-of-the-box defaults would induce
11# breakage / complexity in those mappings
12#
13[MASTER]
14
15# Specify a configuration file.
16# DEFAULT: rcfile=
17
18# Python code to execute, usually for sys.path manipulation such as
19# pygtk.require().
20# DEFAULT: init-hook=
21
22# Profiled execution.
23# DEFAULT: profile=no
24
25# Add files or directories to the blacklist. They should be base names, not
26# paths.
27# DEFAULT: ignore=CVS
28# NOTE: This path must be relative due to the use of
29# os.walk in astroid.modutils.get_module_files.
30
31# Pickle collected data for later comparisons.
32# DEFAULT: persistent=yes
33
34# List of plugins (as comma separated values of python modules names) to load,
35# usually to register additional checkers.
36# DEFAULT: load-plugins=
37
38# DEPRECATED
39# DEFAULT: include-ids=no
40
41# DEPRECATED
42# DEFAULT: symbols=no
43
44
45[MESSAGES CONTROL]
46
Craig Citro4b147c42015-07-19 21:03:45 -070047# TODO: remove cyclic-import.
Craig Citro4572ff02015-05-01 09:14:07 -070048disable =
Craig Citro4b147c42015-07-19 21:03:45 -070049 cyclic-import,
Craig Citro4572ff02015-05-01 09:14:07 -070050 fixme,
51 import-error,
52 locally-disabled,
53 locally-enabled,
54 maybe-no-member,
55 method-hidden,
56 no-init,
57 no-member,
58 no-self-use,
59 redefined-builtin,
60 similarities,
61 star-args,
62 super-on-old-class,
63 too-few-public-methods,
64 too-many-arguments,
65 too-many-branches,
66 too-many-instance-attributes,
67 too-many-locals,
68 too-many-public-methods,
69 too-many-return-statements,
70 too-many-statements,
71
72
73[REPORTS]
74
75# Set the output format. Available formats are text, parseable, colorized, msvs
76# (visual studio) and html. You can also give a reporter class, eg
77# mypackage.mymodule.MyReporterClass.
78# DEFAULT: output-format=text
79
80# Put messages in a separate file for each module / package specified on the
81# command line instead of printing them on stdout. Reports (if any) will be
82# written in a file name "pylint_global.[txt|html]".
83# DEFAULT: files-output=no
84
85# Tells whether to display a full report or only the messages
86# DEFAULT: reports=yes
87# RATIONALE: run from Travis / tox, and don't need / want to parse output.
88reports=no
89
90# Python expression which should return a note less than 10 (10 is the highest
91# note). You have access to the variables errors warning, statement which
92# respectively contain the number of errors / warnings messages and the total
93# number of statements analyzed. This is used by the global evaluation report
94# (RP0004).
95# DEFAULT: evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
96
97# Add a comment according to your evaluation note. This is used by the global
98# evaluation report (RP0004).
99# DEFAULT: comment=no
100
101# Template used to display messages. This is a python new-style format string
102# used to format the message information. See doc for all details
103#msg-template=
104
105
106[SIMILARITIES]
107
108# Minimum lines number of a similarity.
109# DEFAULT: min-similarity-lines=4
110
111# Ignore comments when computing similarities.
112# DEFAULT: ignore-comments=yes
113
114# Ignore docstrings when computing similarities.
115# DEFAULT: ignore-docstrings=yes
116
117# Ignore imports when computing similarities.
118# DEFAULT: ignore-imports=no
119
120
121[VARIABLES]
122
123# Tells whether we should check for unused import in __init__ files.
124# DEFAULT: init-import=no
125
126# A regular expression matching the name of dummy variables (i.e. expectedly
127# not used).
128dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
129
130
131# List of additional names supposed to be defined in builtins. Remember that
132# you should avoid to define new builtins when possible.
133# DEFAULT: additional-builtins=
134
135
136[LOGGING]
137
138# Logging modules to check that the string format arguments are in logging
139# function parameter format
140# DEFAULT: logging-modules=logging
141
142
143[FORMAT]
144
145# Maximum number of characters on a single line.
146# DEFAULT: max-line-length=80
147
148# Regexp for a line that is allowed to be longer than the limit.
149# DEFAULT: ignore-long-lines=^\s*(# )?<?https?://\S+>?$
150
151# Allow the body of an if to be on the same line as the test if there is no
152# else.
153# DEFAULT: single-line-if-stmt=no
154
155# List of optional constructs for which whitespace checking is disabled
156# DEFAULT: no-space-check=trailing-comma,dict-separator
157# RATIONALE: pylint ignores whitespace checks around the
158# constructs "dict-separator" (cases like {1:2}) and
159# "trailing-comma" (cases like {1: 2, }).
160# By setting "no-space-check" to empty whitespace checks will be
161# enforced around both constructs.
162no-space-check =
163
164# Maximum number of lines in a module
165# DEFAULT: max-module-lines=1000
166max-module-lines=1500
167
168# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
169# tab).
170# DEFAULT: indent-string=' '
171
172# Number of spaces of indent required inside a hanging or continued line.
173# DEFAULT: indent-after-paren=4
174
175
176[MISCELLANEOUS]
177
178# List of note tags to take in consideration, separated by a comma.
179# DEFAULT: notes=FIXME,XXX,TODO
180
181
182[BASIC]
183required-attributes=
184
185no-docstring-rgx=(__.*__|main)
186
187docstring-min-length=10
188
189# Regular expression which should only match correct module names. The
190# leading underscore is sanctioned for private modules by Google's style
191# guide.
192module-rgx=^(_?[a-z][a-z0-9_]*)|__init__$
193
194# Regular expression which should only match correct module level names
195const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
196
197# Regular expression which should only match correct class attribute
198class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
199
200# Regular expression which should only match correct class names
201class-rgx=^_?[A-Z][a-zA-Z0-9]*$
202
203# Regular expression which should only match correct function names.
204# 'camel_case' and 'snake_case' group names are used for consistency of naming
205# styles across functions and methods.
206function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
207
208# Regular expression which should only match correct method names.
209# 'camel_case' and 'snake_case' group names are used for consistency of naming
210# styles across functions and methods. 'exempt' indicates a name which is
211# consistent with all naming styles.
212method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
213
214# Regular expression which should only match correct instance attribute names
215attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
216
217# Regular expression which should only match correct argument names
218argument-rgx=^[a-z][a-z0-9_]*$
219
220# Regular expression which should only match correct variable names
221variable-rgx=^[a-z][a-z0-9_]*$
222
223# Regular expression which should only match correct list comprehension /
224# generator expression variable names
225inlinevar-rgx=^[a-z][a-z0-9_]*$
226
227# Good variable names which should always be accepted, separated by a comma
228good-names=main,_
229
230# Bad variable names which should always be refused, separated by a comma
231bad-names=
232
233# List of builtins function names that should not be used, separated by a comma
234# <http://go/python-style#Deprecated_Language_Features>
235bad-functions=input,apply,reduce
236
237# TEMPORARY
238no-docstring-rgx=.*
239
240
241[TYPECHECK]
242
243# Tells whether missing members accessed in mixin class should be ignored. A
244# mixin class is detected if its name ends with "mixin" (case insensitive).
245# DEFAULT: ignore-mixin-members=yes
246
247# List of module names for which member attributes should not be checked
248# (useful for modules/projects where namespaces are manipulated during runtime
249# and thus existing member attributes cannot be deduced by static analysis
250# DEFAULT: ignored-modules=
251
252# List of classes names for which member attributes should not be checked
253# (useful for classes with attributes dynamically set).
254# DEFAULT: ignored-classes=SQLObject
255
256# When zope mode is activated, add a predefined set of Zope acquired attributes
257# to generated-members.
258# DEFAULT: zope=no
259
260# List of members which are set dynamically and missed by pylint inference
261# system, and so shouldn't trigger E0201 when accessed. Python regular
262# expressions are accepted.
263# DEFAULT: generated-members=REQUEST,acl_users,aq_parent
264
265
266[IMPORTS]
267
268# Deprecated modules which should not be used, separated by a comma
269# DEFAULT: deprecated-modules=regsub,TERMIOS,Bastion,rexec
270
271# Create a graph of every (i.e. internal and external) dependencies in the
272# given file (report RP0402 must not be disabled)
273# DEFAULT: import-graph=
274
275# Create a graph of external dependencies in the given file (report RP0402 must
276# not be disabled)
277# DEFAULT: ext-import-graph=
278
279# Create a graph of internal dependencies in the given file (report RP0402 must
280# not be disabled)
281# DEFAULT: int-import-graph=
282
283
284[CLASSES]
285
286# List of interface methods to ignore, separated by a comma. This is used for
287# instance to not check methods defines in Zope's Interface base class.
288# DEFAULT: ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
289
290# List of method names used to declare (i.e. assign) instance attributes.
291# DEFAULT: defining-attr-methods=__init__,__new__,setUp
292
293# List of valid names for the first argument in a class method.
294# DEFAULT: valid-classmethod-first-arg=cls
295
296# List of valid names for the first argument in a metaclass class method.
297# DEFAULT: valid-metaclass-classmethod-first-arg=mcs
298
299
300[DESIGN]
301
302# Maximum number of arguments for function / method
303# DEFAULT: max-args=5
304# RATIONALE: API-mapping
305max-args = 10
306
307# Argument names that match this expression will be ignored. Default to name
308# with leading underscore
309# DEFAULT: ignored-argument-names=_.*
310
311# Maximum number of locals for function / method body
312# DEFAULT: max-locals=15
313max-locals=20
314
315# Maximum number of return / yield for function / method body
316# DEFAULT: max-returns=6
317
318# Maximum number of branch for function / method body
319# DEFAULT: max-branches=12
320
321# Maximum number of statements in function / method body
322# DEFAULT: max-statements=50
323
324# Maximum number of parents for a class (see R0901).
325# DEFAULT: max-parents=7
326
327# Maximum number of attributes for a class (see R0902).
328# DEFAULT: max-attributes=7
329# RATIONALE: API mapping
330max-attributes=15
331
332# Minimum number of public methods for a class (see R0903).
333# DEFAULT: min-public-methods=2
334# RATIONALE: context mgrs may have *no* public methods
335min-public-methods=0
336
337# Maximum number of public methods for a class (see R0904).
338# DEFAULT: max-public-methods=20
339# RATIONALE: API mapping
340max-public-methods=40
341
342
343[EXCEPTIONS]
344
345# Exceptions that will emit a warning when being caught. Defaults to
346# "Exception"
347# DEFAULT: overgeneral-exceptions=Exception