blob: 7d6abe3f4bce57e48666e66e6965a506b859a643 [file] [log] [blame]
Jan Monsch23e0c622019-12-11 11:23:58 +01001# Copyright 2016 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15[MASTER]
16
17# Specify a configuration file.
18#rcfile=
19
20# Python code to execute, usually for sys.path manipulation such as
21# pygtk.require().
22#init-hook=
23
24# Profiled execution.
25profile=no
26
27# Add files or directories to the blacklist. They should be base names, not
28# paths.
29ignore=CVS,.svn,.git
Jan Monsch73645ec2019-12-18 13:52:26 +010030ignore-patterns=.*pb2\.py,.*pb2_grpc\.py
Jan Monsch23e0c622019-12-11 11:23:58 +010031
32# Pickle collected data for later comparisons.
33persistent=yes
34
35# List of plugins (as comma separated values of python modules names) to load,
36# usually to register additional checkers.
37load-plugins=
38 pylint.extensions.bad_builtin,
39 pylint.extensions.check_elif,
40 pylint.extensions.docstyle,
41 pylint.extensions.emptystring,
42 pylint.extensions.overlapping_exceptions,
43 pylint.extensions.redefined_variable_type,
44
45# Use multiple processes to speed up Pylint. A value of 0 autodetects available
46# processors.
47jobs=0
48
49# Allow loading of arbitrary C extensions. Extensions are imported into the
50# active Python interpreter and may run arbitrary code.
51unsafe-load-any-extension=no
52
53# A comma-separated list of package or module names from where C extensions may
54# be loaded. Extensions are loading into the active Python interpreter and may
55# run arbitrary code
56extension-pkg-whitelist=
57
58# Allow optimization of some AST trees. This will activate a peephole AST
59# optimizer, which will apply various small optimizations. For instance, it can
60# be used to obtain the result of joining multiple strings with the addition
61# operator. Joining a lot of strings can lead to a maximum recursion error in
62# Pylint and this flag can prevent that. It has one side effect, the resulting
63# AST will be different than the one from reality.
64optimize-ast=no
65
66
67[MESSAGES CONTROL]
68
69# Only show warnings with the listed confidence levels. Leave empty to show
70# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
71confidence=
72
73# Enable the message, report, category or checker with the given id(s). You can
74# either give multiple identifier separated by comma (,) or put this option
75# multiple time. See also the "--disable" option for examples.
76enable=
77 apply-builtin,
78 backtick,
79 bad-python3-import,
80 basestring-builtin,
81 buffer-builtin,
82 cmp-builtin,
83 cmp-method,
84 coerce-builtin,
85 coerce-method,
86 delslice-method,
87 deprecated-itertools-function,
88 deprecated-str-translate-call,
89 deprecated-string-function,
90 deprecated-types-field,
91 dict-items-not-iterating,
92 dict-iter-method,
93 dict-keys-not-iterating,
94 dict-values-not-iterating,
95 dict-view-method,
96 div-method,
97 exception-message-attribute,
98 execfile-builtin,
99 file-builtin,
100 filter-builtin-not-iterating,
101 getslice-method,
102 hex-method,
103 idiv-method,
104 import-star-module-level,
105 indexing-exception,
106 input-builtin,
107 intern-builtin,
108 invalid-str-codec,
109 long-builtin,
110 long-suffix,
111 map-builtin-not-iterating,
112 metaclass-assignment,
113 next-method-called,
114 next-method-defined,
115 nonzero-method,
116 oct-method,
117 old-division,
118 old-ne-operator,
119 old-octal-literal,
120 old-raise-syntax,
121 parameter-unpacking,
122 print-statement,
123 raising-string,
124 range-builtin-not-iterating,
125 raw_input-builtin,
126 rdiv-method,
127 reduce-builtin,
128 reload-builtin,
129 round-builtin,
130 setslice-method,
131 standarderror-builtin,
132 sys-max-int,
133 unichr-builtin,
134 unicode-builtin,
135 unpacking-in-except,
136 using-cmp-argument,
137 xrange-builtin,
138 zip-builtin-not-iterating,
139
140
141# Disable the message, report, category or checker with the given id(s). You
142# can either give multiple identifiers separated by comma (,) or put this
143# option multiple times (only on the command line, not in the configuration
144# file where it should appear only once).You can also use "--disable=all" to
145# disable everything first and then reenable specific checks. For example, if
146# you want to run only the similarities checker, you can use "--disable=all
147# --enable=similarities". If you want to run only the classes checker, but have
148# no Warning level messages displayed, use"--disable=all --enable=classes
149# --disable=W"
150# We leave many of the style warnings to judgement/peer review.
151# useless-object-inheritance: We disable this for Python 2 compatibility.
152disable=
153 fixme,
154 file-ignored,
155 invalid-name,
156 locally-disabled,
157 locally-enabled,
158 missing-docstring,
159 no-self-use,
160 star-args,
161 too-few-public-methods,
162 too-many-arguments,
163 too-many-branches,
164 too-many-instance-attributes,
165 too-many-lines,
166 too-many-locals,
167 too-many-public-methods,
168 too-many-return-statements,
169 too-many-statements,
170 useless-object-inheritance,
171
172
173[REPORTS]
174
175# Set the output format. Available formats are text, parseable, colorized, msvs
176# (visual studio) and html. You can also give a reporter class, eg
177# mypackage.mymodule.MyReporterClass.
178output-format=text
179
180# Put messages in a separate file for each module / package specified on the
181# command line instead of printing them on stdout. Reports (if any) will be
182# written in a file name "pylint_global.[txt|html]".
183files-output=no
184
185# Tells whether to display a full report or only the messages
186reports=no
187
188# Activate the evaluation score.
189score=no
190
191# Python expression which should return a note less than 10 (10 is the highest
192# note). You have access to the variables errors warning, statement which
193# respectively contain the number of errors / warnings messages and the total
194# number of statements analyzed. This is used by the global evaluation report
195# (RP0004).
196#evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
197
198# Template used to display messages. This is a python new-style format string
199# used to format the message information. See doc for all details
200#msg-template=
201
202
203[SIMILARITIES]
204
205# Minimum lines number of a similarity.
206min-similarity-lines=20
207
208# Ignore comments when computing similarities.
209ignore-comments=yes
210
211# Ignore docstrings when computing similarities.
212ignore-docstrings=yes
213
214# Ignore imports when computing similarities.
215ignore-imports=no
216
217
218[TYPECHECK]
219
220# Tells whether missing members accessed in mixin class should be ignored. A
221# mixin class is detected if its name ends with "mixin" (case insensitive).
222ignore-mixin-members=yes
223
224# List of module names for which member attributes should not be checked
225# (useful for modules/projects where namespaces are manipulated during runtime
226# and thus existing member attributes cannot be deduced by static analysis. It
227# supports qualified module names, as well as Unix pattern matching.
228ignored-modules=
229
230# List of classes names for which member attributes should not be checked
231# (useful for classes with attributes dynamically set). This supports can work
232# with qualified names.
233ignored-classes=hashlib,numpy
234
235# List of members which are set dynamically and missed by pylint inference
236# system, and so shouldn't trigger E1101 when accessed. Python regular
237# expressions are accepted.
238generated-members=
239
240
241[SPELLING]
242
243# Spelling dictionary name. Available dictionaries: none. To make it working
244# install python-enchant package.
245spelling-dict=
246
247# List of comma separated words that should not be checked.
248spelling-ignore-words=
249
250# A path to a file that contains private dictionary; one word per line.
251spelling-private-dict-file=
252
253# Tells whether to store unknown words to indicated private dictionary in
254# --spelling-private-dict-file option instead of raising a message.
255spelling-store-unknown-words=no
256
257
258[LOGGING]
259
260# Logging modules to check that the string format arguments are in logging
261# function parameter format
262logging-modules=logging
263
264
265[VARIABLES]
266
267# Tells whether we should check for unused import in __init__ files.
268init-import=no
269
270# A regular expression matching the name of dummy variables (i.e. expectedly
271# not used).
272dummy-variables-rgx=_|unused_
273
274# List of additional names supposed to be defined in builtins. Remember that
275# you should avoid to define new builtins when possible.
276additional-builtins=
277
278# List of strings which can identify a callback function by name. A callback
279# name must start or end with one of those strings.
280callbacks=cb_,_cb
281
282
283[FORMAT]
284
285# Maximum number of characters on a single line.
286max-line-length=80
287
288# Regexp for a line that is allowed to be longer than the limit.
289ignore-long-lines=^\s*(# )?<?https?://\S+>?$
290
291# Allow the body of an if to be on the same line as the test if there is no
292# else.
293single-line-if-stmt=no
294
295# List of optional constructs for which whitespace checking is disabled. `dict-
296# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
297# `trailing-comma` allows a space between comma and closing bracket: (a, ).
298# `empty-line` allows space-only lines.
299no-space-check=trailing-comma,dict-separator
300
301# Maximum number of lines in a module
302max-module-lines=1000
303
304# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
305# tab).
306indent-string=' '
307
308# Number of spaces of indent required inside a hanging or continued line.
309indent-after-paren=4
310
311# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
312expected-line-ending-format=LF
313
314
315[MISCELLANEOUS]
316
317# List of note tags to take in consideration, separated by a comma.
318notes=FIXME,XXX,TODO
319
320
321[BASIC]
322
323# List of builtins function names that should not be used, separated by a comma
324bad-functions=map,filter,input
325
326# Good variable names which should always be accepted, separated by a comma
327good-names=i,j,k,ex,x,_
328
329# Bad variable names which should always be refused, separated by a comma
330bad-names=foo,bar,baz,toto,tutu,tata
331
332# Colon-delimited sets of names that determine each other's naming style when
333# the name regexes allow several styles.
334name-group=
335
336# Include a hint for the correct naming format with invalid-name
337include-naming-hint=no
338
339# Regular expression matching correct function names
340function-rgx=[a-z_][a-z0-9_]{2,30}$
341
342# Naming hint for function names
343function-name-hint=[a-z_][a-z0-9_]{2,30}$
344
345# Regular expression matching correct variable names
346variable-rgx=[a-z_][a-z0-9_]{2,30}$
347
348# Naming hint for variable names
349variable-name-hint=[a-z_][a-z0-9_]{2,30}$
350
351# Regular expression matching correct constant names
352const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
353
354# Naming hint for constant names
355const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
356
357# Regular expression matching correct attribute names
358attr-rgx=[a-z_][a-z0-9_]{2,30}$
359
360# Naming hint for attribute names
361attr-name-hint=[a-z_][a-z0-9_]{2,30}$
362
363# Regular expression matching correct argument names
364argument-rgx=[a-z_][a-z0-9_]{2,30}$
365
366# Naming hint for argument names
367argument-name-hint=[a-z_][a-z0-9_]{2,30}$
368
369# Regular expression matching correct class attribute names
370class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
371
372# Naming hint for class attribute names
373class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
374
375# Regular expression matching correct inline iteration names
376inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
377
378# Naming hint for inline iteration names
379inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
380
381# Regular expression matching correct class names
382class-rgx=[A-Z_][a-zA-Z0-9]+$
383
384# Naming hint for class names
385class-name-hint=[A-Z_][a-zA-Z0-9]+$
386
387# Regular expression matching correct module names
388module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
389
390# Naming hint for module names
391module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
392
393# Regular expression which should only match correct method names
394method-rgx=[a-z_][a-z0-9_]{2,30}$
395
396# Naming hint for method names
397method-name-hint=[a-z_][a-z0-9_]{2,30}$
398
399# Regular expression which should only match function or class names that do
400# not require a docstring.
401no-docstring-rgx=^_
402
403# Minimum line length for functions/classes that require docstrings, shorter
404# ones are exempt.
405docstring-min-length=10
406
407
408[ELIF]
409
410# Maximum number of nested blocks for function / method body
411max-nested-blocks=5
412
413
414[DESIGN]
415
416# Maximum number of arguments for function / method
417max-args=5
418
419# Argument names that match this expression will be ignored. Default to name
420# with leading underscore
421ignored-argument-names=_.*
422
423# Maximum number of locals for function / method body
424max-locals=15
425
426# Maximum number of return / yield for function / method body
427max-returns=6
428
429# Maximum number of branch for function / method body
430max-branches=12
431
432# Maximum number of statements in function / method body
433max-statements=50
434
435# Maximum number of parents for a class (see R0901).
436max-parents=10
437
438# Maximum number of attributes for a class (see R0902).
439max-attributes=7
440
441# Minimum number of public methods for a class (see R0903).
442min-public-methods=2
443
444# Maximum number of public methods for a class (see R0904).
445max-public-methods=20
446
447# Maximum number of boolean expressions in a if statement
448max-bool-expr=5
449
450
451[CLASSES]
452
453# List of method names used to declare (i.e. assign) instance attributes.
454defining-attr-methods=__init__,__new__,setUp
455
456# List of valid names for the first argument in a class method.
457valid-classmethod-first-arg=cls
458
459# List of valid names for the first argument in a metaclass class method.
460valid-metaclass-classmethod-first-arg=mcs
461
462# List of member names, which should be excluded from the protected access
463# warning.
464exclude-protected=_asdict,_fields,_replace,_source,_make
465
466
467[IMPORTS]
468
469# Deprecated modules which should not be used, separated by a comma
470deprecated-modules=regsub,TERMIOS,Bastion,rexec,optparse
471
472# Create a graph of every (i.e. internal and external) dependencies in the
473# given file (report RP0402 must not be disabled)
474import-graph=
475
476# Create a graph of external dependencies in the given file (report RP0402 must
477# not be disabled)
478ext-import-graph=
479
480# Create a graph of internal dependencies in the given file (report RP0402 must
481# not be disabled)
482int-import-graph=
483
484
485[EXCEPTIONS]
486
487# Exceptions that will emit a warning when being caught. Defaults to
488# "Exception"
489overgeneral-exceptions=Exception