• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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
47# TODO: remove cyclic-import.
48disable =
49    cyclic-import,
50    fixme,
51    import-error,
52    locally-disabled,
53    locally-enabled,
54    no-member,
55    no-name-in-module,
56    no-self-use,
57    super-on-old-class,
58    too-many-arguments,
59    too-many-function-args,
60
61
62[REPORTS]
63
64# Set the output format. Available formats are text, parseable, colorized, msvs
65# (visual studio) and html. You can also give a reporter class, eg
66# mypackage.mymodule.MyReporterClass.
67# DEFAULT:  output-format=text
68
69# Put messages in a separate file for each module / package specified on the
70# command line instead of printing them on stdout. Reports (if any) will be
71# written in a file name "pylint_global.[txt|html]".
72# DEFAULT:  files-output=no
73
74# Tells whether to display a full report or only the messages
75# DEFAULT:  reports=yes
76# RATIONALE:  run from Travis / tox, and don't need / want to parse output.
77reports=no
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# (RP0004).
84# DEFAULT:  evaluation=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 (RP0004).
88# DEFAULT:  comment=no
89
90# Template used to display messages. This is a python new-style format string
91# used to format the message information. See doc for all details
92#msg-template=
93
94
95[SIMILARITIES]
96
97# Minimum lines number of a similarity.
98# DEFAULT:  min-similarity-lines=4
99min-similarity-lines=15
100
101# Ignore comments when computing similarities.
102# DEFAULT:  ignore-comments=yes
103
104# Ignore docstrings when computing similarities.
105# DEFAULT:  ignore-docstrings=yes
106
107# Ignore imports when computing similarities.
108# DEFAULT:  ignore-imports=no
109ignore-imports=yes
110
111
112[VARIABLES]
113
114# Tells whether we should check for unused import in __init__ files.
115# DEFAULT:  init-import=no
116
117# A regular expression matching the name of dummy variables (i.e. expectedly
118# not used).
119dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
120
121
122# List of additional names supposed to be defined in builtins. Remember that
123# you should avoid to define new builtins when possible.
124# DEFAULT:  additional-builtins=
125
126
127[LOGGING]
128
129# Logging modules to check that the string format arguments are in logging
130# function parameter format
131# DEFAULT:  logging-modules=logging
132
133
134[FORMAT]
135
136# Maximum number of characters on a single line.
137# DEFAULT:  max-line-length=80
138
139# Regexp for a line that is allowed to be longer than the limit.
140# DEFAULT:  ignore-long-lines=^\s*(# )?<?https?://\S+>?$
141
142# Allow the body of an if to be on the same line as the test if there is no
143# else.
144# DEFAULT:  single-line-if-stmt=no
145
146# List of optional constructs for which whitespace checking is disabled
147# DEFAULT:  no-space-check=trailing-comma,dict-separator
148# RATIONALE: pylint ignores whitespace checks around the
149#            constructs "dict-separator" (cases like {1:2}) and
150#            "trailing-comma" (cases like {1: 2, }).
151#            By setting "no-space-check" to empty whitespace checks will be
152#            enforced around both constructs.
153no-space-check =
154
155# Maximum number of lines in a module
156# DEFAULT:  max-module-lines=1000
157max-module-lines=1500
158
159# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
160# tab).
161# DEFAULT:  indent-string='    '
162
163# Number of spaces of indent required inside a hanging or continued line.
164# DEFAULT:  indent-after-paren=4
165
166
167[MISCELLANEOUS]
168
169# List of note tags to take in consideration, separated by a comma.
170# DEFAULT:  notes=FIXME,XXX,TODO
171
172
173[BASIC]
174
175# Regular expression which should only match function or class names that do
176# not require a docstring.
177# DEFAULT:  no-docstring-rgx=__.*__
178no-docstring-rgx=(__.*__|main)
179
180# Minimum line length for functions/classes that require docstrings, shorter
181# ones are exempt.
182# DEFAULT:  docstring-min-length=-1
183docstring-min-length=10
184
185# Regular expression which should only match correct module names. The
186# leading underscore is sanctioned for private modules by Google's style
187# guide.
188module-rgx=^(_?[a-z][a-z0-9_]*)|__init__$
189
190# Regular expression matching correct constant names
191# DEFAULT:  const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
192const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
193
194# Regular expression matching correct class attribute names
195# DEFAULT:  class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
196class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
197
198# Regular expression matching correct class names
199# DEFAULT:  class-rgx=[A-Z_][a-zA-Z0-9]+$
200class-rgx=^_?[A-Z][a-zA-Z0-9]*$
201
202# Regular expression which should only match correct function names.
203# 'camel_case' and 'snake_case' group names are used for consistency of naming
204# styles across functions and methods.
205function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
206
207# Regular expression which should only match correct method names.
208# 'camel_case' and 'snake_case' group names are used for consistency of naming
209# styles across functions and methods. 'exempt' indicates a name which is
210# consistent with all naming styles.
211method-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_]*))$
212
213# Regular expression matching correct attribute names
214# DEFAULT:  attr-rgx=[a-z_][a-z0-9_]{2,30}$
215attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
216
217# Regular expression matching correct argument names
218# DEFAULT:  argument-rgx=[a-z_][a-z0-9_]{2,30}$
219argument-rgx=^[a-z][a-z0-9_]*$
220
221# Regular expression matching correct variable names
222# DEFAULT:  variable-rgx=[a-z_][a-z0-9_]{2,30}$
223variable-rgx=^[a-z][a-z0-9_]*$
224
225# Regular expression matching correct inline iteration names
226# DEFAULT:  inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
227inlinevar-rgx=^[a-z][a-z0-9_]*$
228
229# Good variable names which should always be accepted, separated by a comma
230# DEFAULT:  good-names=i,j,k,ex,Run,_
231good-names=main,_
232
233# Bad variable names which should always be refused, separated by a comma
234# DEFAULT:  bad-names=foo,bar,baz,toto,tutu,tata
235bad-names=
236
237# List of builtins function names that should not be used, separated by a comma
238# <http://go/python-style#Deprecated_Language_Features>
239bad-functions=input,apply,reduce
240
241
242[TYPECHECK]
243
244# Tells whether missing members accessed in mixin class should be ignored. A
245# mixin class is detected if its name ends with "mixin" (case insensitive).
246# DEFAULT:  ignore-mixin-members=yes
247
248# List of module names for which member attributes should not be checked
249# (useful for modules/projects where namespaces are manipulated during runtime
250# and thus existing member attributes cannot be deduced by static analysis
251# DEFAULT:  ignored-modules=
252
253# List of classes names for which member attributes should not be checked
254# (useful for classes with attributes dynamically set).
255# DEFAULT:  ignored-classes=SQLObject
256
257# When zope mode is activated, add a predefined set of Zope acquired attributes
258# to generated-members.
259# DEFAULT:  zope=no
260
261# List of members which are set dynamically and missed by pylint inference
262# system, and so shouldn't trigger E0201 when accessed. Python regular
263# expressions are accepted.
264# DEFAULT:  generated-members=REQUEST,acl_users,aq_parent
265
266
267[IMPORTS]
268
269# Deprecated modules which should not be used, separated by a comma
270# DEFAULT:  deprecated-modules=regsub,TERMIOS,Bastion,rexec
271
272# Create a graph of every (i.e. internal and external) dependencies in the
273# given file (report RP0402 must not be disabled)
274# DEFAULT:  import-graph=
275
276# Create a graph of external dependencies in the given file (report RP0402 must
277# not be disabled)
278# DEFAULT:  ext-import-graph=
279
280# Create a graph of internal dependencies in the given file (report RP0402 must
281# not be disabled)
282# DEFAULT:  int-import-graph=
283
284
285[CLASSES]
286
287# List of interface methods to ignore, separated by a comma. This is used for
288# instance to not check methods defines in Zope's Interface base class.
289# DEFAULT:  ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
290
291# List of method names used to declare (i.e. assign) instance attributes.
292# DEFAULT:  defining-attr-methods=__init__,__new__,setUp
293
294# List of valid names for the first argument in a class method.
295# DEFAULT:  valid-classmethod-first-arg=cls
296
297# List of valid names for the first argument in a metaclass class method.
298# DEFAULT:  valid-metaclass-classmethod-first-arg=mcs
299
300
301[DESIGN]
302
303# Maximum number of arguments for function / method
304# DEFAULT:  max-args=5
305# RATIONALE:  API-mapping
306max-args = 14
307
308# Argument names that match this expression will be ignored. Default to name
309# with leading underscore
310# DEFAULT:  ignored-argument-names=_.*
311
312# Maximum number of locals for function / method body
313# DEFAULT:  max-locals=15
314max-locals=24
315
316# Maximum number of return / yield for function / method body
317# DEFAULT:  max-returns=6
318max-returns=9
319
320# Maximum number of branch for function / method body
321# DEFAULT:  max-branches=12
322max-branches=21
323
324# Maximum number of statements in function / method body
325# DEFAULT:  max-statements=50
326
327# Maximum number of parents for a class (see R0901).
328# DEFAULT:  max-parents=7
329
330# Maximum number of attributes for a class (see R0902).
331# DEFAULT:  max-attributes=7
332# RATIONALE:  API mapping
333max-attributes=19
334
335# Minimum number of public methods for a class (see R0903).
336# DEFAULT:  min-public-methods=2
337# RATIONALE:  context mgrs may have *no* public methods
338min-public-methods=0
339
340# Maximum number of public methods for a class (see R0904).
341# DEFAULT:  max-public-methods=20
342# RATIONALE:  API mapping
343max-public-methods=40
344
345[ELIF]
346max-nested-blocks=6
347
348[EXCEPTIONS]
349
350# Exceptions that will emit a warning when being caught. Defaults to
351# "Exception"
352# DEFAULT:  overgeneral-exceptions=Exception
353