blob: a8878c89567635430d8c8237c9ce1d5a61573964 [file] [log] [blame]
Rob Mohr58254ae2021-05-21 16:08:27 -07001[MASTER] # inclusive-language: ignore
Wyatt Heplerb627b412019-11-27 09:41:25 -08002
3# A comma-separated list of package or module names from where C extensions may
4# be loaded. Extensions are loading into the active Python interpreter and may
5# run arbitrary code.
Rob Mohr58254ae2021-05-21 16:08:27 -07006# inclusive-language: disable
Rob Mohr59d645c2020-10-12 12:36:52 -07007# TODO(pwbug/280) Change "whitelist" to "allowlist". (Blocked on pylint.)
Wyatt Heplerb627b412019-11-27 09:41:25 -08008extension-pkg-whitelist=mypy
Rob Mohr58254ae2021-05-21 16:08:27 -07009# inclusive-language: enable
Wyatt Heplerb627b412019-11-27 09:41:25 -080010
Rob Mohrc26cb512020-10-12 11:41:54 -070011# Add files or directories to the blocklist. They should be base names, not
Wyatt Heplerb627b412019-11-27 09:41:25 -080012# paths.
13ignore=CVS
14
Rob Mohrc26cb512020-10-12 11:41:54 -070015# Add files or directories matching the regex patterns to the blocklist. The
Wyatt Heplerb627b412019-11-27 09:41:25 -080016# regex matches against base names, not paths.
17ignore-patterns=
18
19# Python code to execute, usually for sys.path manipulation such as
20# pygtk.require().
21#init-hook=
22
23# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
24# number of processors available to use.
25jobs=0
26
27# Control the amount of potential inferred values when inferring a single
28# object. This can help the performance when dealing with large functions or
29# complex, nested conditions.
30limit-inference-results=100
31
32# List of plugins (as comma separated values of python module names) to load,
33# usually to register additional checkers.
34load-plugins=
35
36# Pickle collected data for later comparisons.
37persistent=yes
38
39# Specify a configuration file.
40#rcfile=
41
42# When enabled, pylint would attempt to guess common misconfiguration and emit
43# user-friendly hints instead of false-positive error messages.
44suggestion-mode=yes
45
46# Allow loading of arbitrary C extensions. Extensions are imported into the
47# active Python interpreter and may run arbitrary code.
48unsafe-load-any-extension=no
49
50
51[MESSAGES CONTROL]
52
53# Only show warnings with the listed confidence levels. Leave empty to show
54# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
55confidence=
56
57# Disable the message, report, category or checker with the given id(s). You
58# can either give multiple identifiers separated by comma (,) or put this
59# option multiple times (only on the command line, not in the configuration
60# file where it should appear only once). You can also use "--disable=all" to
61# disable everything first and then reenable specific checks. For example, if
62# you want to run only the similarities checker, you can use "--disable=all
63# --enable=similarities". If you want to run only the classes checker, but have
64# no Warning level messages displayed, use "--disable=all --enable=classes
65# --disable=W".
Wyatt Heplerb16dfd32020-10-12 08:46:38 -070066disable=bad-continuation, # Rely on yapf for formatting
Wyatt Heplera352d572021-07-12 08:59:41 -070067 consider-using-with,
Wyatt Heplerb16dfd32020-10-12 08:46:38 -070068 fixme,
Wyatt Hepler2e3619d2020-10-29 12:52:52 -070069 subprocess-run-check,
70 raise-missing-from,
Wyatt Heplerb627b412019-11-27 09:41:25 -080071
72# Enable the message, report, category or checker with the given id(s). You can
73# either give multiple identifier separated by comma (,) or put this option
74# multiple time (only on the command line, not in the configuration file where
75# it should appear only once). See also the "--disable" option for examples.
Wyatt Hepler2e3619d2020-10-29 12:52:52 -070076enable=c-extension-no-member,
Wyatt Heplerb627b412019-11-27 09:41:25 -080077
78
79[REPORTS]
80
81# Python expression which should return a score less than or equal to 10. You
82# have access to the variables 'error', 'warning', 'refactor', and 'convention'
83# which contain the number of messages in each category, as well as 'statement'
84# which is the total number of statements analyzed. This score is used by the
85# global evaluation report (RP0004).
86evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
87
88# Template used to display messages. This is a python new-style format string
89# used to format the message information. See doc for all details.
90#msg-template=
91
92# Set the output format. Available formats are text, parseable, colorized, json
93# and msvs (visual studio). You can also give a reporter class, e.g.
94# mypackage.mymodule.MyReporterClass.
Wyatt Hepler2e3619d2020-10-29 12:52:52 -070095output-format=colorized
Wyatt Heplerb627b412019-11-27 09:41:25 -080096
97# Tells whether to display a full report or only the messages.
98reports=no
99
100# Activate the evaluation score.
101score=no
102
103
104[REFACTORING]
105
106# Maximum number of nested blocks for function / method body
107max-nested-blocks=5
108
109# Complete name of functions that never returns. When checking for
110# inconsistent-return-statements if a never returning function is called then
111# it will be considered as an explicit return statement and no message will be
112# printed.
113never-returning-functions=sys.exit
114
115
116[FORMAT]
117
118# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
119expected-line-ending-format=LF
120
121# Regexp for a line that is allowed to be longer than the limit.
122ignore-long-lines=^\s*(# )?<?https?://\S+>?$
123
124# Number of spaces of indent required inside a hanging or continued line.
125indent-after-paren=4
126
127# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
128# tab).
129indent-string=' '
130
131# Maximum number of characters on a single line.
132max-line-length=80
133
134# Maximum number of lines in a module.
135max-module-lines=9999
136
137# List of optional constructs for which whitespace checking is disabled. `dict-
138# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
139# `trailing-comma` allows a space between comma and closing bracket: (a, ).
140# `empty-line` allows space-only lines.
141no-space-check=trailing-comma,
142 dict-separator
143
144# Allow the body of a class to be on the same line as the declaration if body
145# contains single statement.
146single-line-class-stmt=no
147
148# Allow the body of an if to be on the same line as the test if there is no
149# else.
150single-line-if-stmt=no
151
152
153[VARIABLES]
154
155# List of additional names supposed to be defined in builtins. Remember that
156# you should avoid defining new builtins when possible.
157additional-builtins=
158
159# Tells whether unused global variables should be treated as a violation.
160allow-global-unused-variables=yes
161
162# List of strings which can identify a callback function by name. A callback
163# name must start or end with one of those strings.
164callbacks=cb_,
165 _cb
166
Rob Mohr58254ae2021-05-21 16:08:27 -0700167# A regular expression matching the name of placeholder variables (i.e.
168# expected to not be used). # inclusive-language: ignore
Wyatt Heplerb627b412019-11-27 09:41:25 -0800169dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
170
171# Argument names that match this expression will be ignored. Default to name
172# with leading underscore.
173ignored-argument-names=_.*|^ignored_|^unused_
174
175# Tells whether we should check for unused import in __init__ files.
176init-import=no
177
178# List of qualified module names which can have objects that can redefine
179# builtins.
180redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
181
182
183[SPELLING]
184
185# Limits count of emitted suggestions for spelling mistakes.
186max-spelling-suggestions=4
187
188# Spelling dictionary name. Available dictionaries: none. To make it work,
189# install the python-enchant package.
190spelling-dict=
191
192# List of comma separated words that should not be checked.
193spelling-ignore-words=
194
195# A path to a file that contains the private dictionary; one word per line.
196spelling-private-dict-file=
197
198# Tells whether to store unknown words to the private dictionary (see the
199# --spelling-private-dict-file option) instead of raising a message.
200spelling-store-unknown-words=no
201
202
203[LOGGING]
204
205# Format style used to check logging format string. `old` means using %
206# formatting, `new` is for `{}` formatting,and `fstr` is for f-strings.
207logging-format-style=old
208
209# Logging modules to check that the string format arguments are in logging
210# function parameter format.
211logging-modules=logging
212
213
214[SIMILARITIES]
215
216# Ignore comments when computing similarities.
217ignore-comments=yes
218
219# Ignore docstrings when computing similarities.
220ignore-docstrings=yes
221
222# Ignore imports when computing similarities.
223ignore-imports=no
224
225# Minimum lines number of a similarity.
226min-similarity-lines=4
227
228
229[MISCELLANEOUS]
230
231# List of note tags to take in consideration, separated by a comma.
232notes=FIXME,
233 XXX,
234 TODO
235
236
237[STRING]
238
239# This flag controls whether the implicit-str-concat-in-sequence should
240# generate a warning on implicit string concatenation in sequences defined over
241# several lines.
242check-str-concat-over-line-jumps=no
243
244
245[BASIC]
246
247# Naming style matching correct argument names.
248argument-naming-style=snake_case
249
250# Regular expression matching correct argument names. Overrides argument-
251# naming-style.
252#argument-rgx=
253
254# Naming style matching correct attribute names.
255attr-naming-style=snake_case
256
257# Regular expression matching correct attribute names. Overrides attr-naming-
258# style.
259#attr-rgx=
260
261# Bad variable names which should always be refused, separated by a comma.
262bad-names=foo,
263 bar,
264 baz,
265 toto,
266 tutu,
267 tata
268
269# Naming style matching correct class attribute names.
270class-attribute-naming-style=any
271
272# Regular expression matching correct class attribute names. Overrides class-
273# attribute-naming-style.
274#class-attribute-rgx=
275
276# Naming style matching correct class names.
277class-naming-style=PascalCase
278
279# Regular expression matching correct class names. Overrides class-naming-
280# style.
281#class-rgx=
282
283# Naming style matching correct constant names.
284const-naming-style=UPPER_CASE
285
286# Regular expression matching correct constant names. Overrides const-naming-
287# style.
Wyatt Hepler8635af92019-12-05 16:32:44 -0800288const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
Wyatt Heplerb627b412019-11-27 09:41:25 -0800289
290# Minimum line length for functions/classes that require docstrings, shorter
291# ones are exempt.
292docstring-min-length=30
293
294# Naming style matching correct function names.
295function-naming-style=snake_case
296
297# Regular expression matching correct function names. Overrides function-
298# naming-style.
299#function-rgx=
300
301# Good variable names which should always be accepted, separated by a comma.
302good-names=i,
303 j,
304 k,
Wyatt Heplerbc254972020-01-06 18:35:30 -0800305 db,
Wyatt Heplerb627b412019-11-27 09:41:25 -0800306 ex,
307 fd,
Wyatt Hepler5cfde332020-06-30 08:53:44 -0700308 id,
Wyatt Heplerbc254972020-01-06 18:35:30 -0800309 ok,
Wyatt Heplerb627b412019-11-27 09:41:25 -0800310 Run,
Alexei Frolov77e7a612019-12-27 13:41:31 -0800311 T,
Wyatt Heplerb627b412019-11-27 09:41:25 -0800312 _
313
314# Include a hint for the correct naming format with invalid-name.
315include-naming-hint=no
316
317# Naming style matching correct inline iteration names.
318inlinevar-naming-style=any
319
320# Regular expression matching correct inline iteration names. Overrides
321# inlinevar-naming-style.
322#inlinevar-rgx=
323
324# Naming style matching correct method names.
325method-naming-style=snake_case
326
327# Regular expression matching correct method names. Overrides method-naming-
328# style.
329#method-rgx=
330
331# Naming style matching correct module names.
332module-naming-style=snake_case
333
334# Regular expression matching correct module names. Overrides module-naming-
335# style.
336#module-rgx=
337
338# Colon-delimited sets of names that determine each other's naming style when
339# the name regexes allow several styles.
340name-group=
341
342# Regular expression which should only match function or class names that do
343# not require a docstring.
344no-docstring-rgx=^_
345
346# List of decorators that produce properties, such as abc.abstractproperty. Add
347# to this list to register other decorators that produce valid properties.
348# These decorators are taken in consideration only for invalid-name.
349property-classes=abc.abstractproperty
350
351# Naming style matching correct variable names.
352variable-naming-style=snake_case
353
354# Regular expression matching correct variable names. Overrides variable-
355# naming-style.
356#variable-rgx=
357
358
359[TYPECHECK]
360
361# List of decorators that produce context managers, such as
362# contextlib.contextmanager. Add to this list to register other decorators that
363# produce valid context managers.
364contextmanager-decorators=contextlib.contextmanager
365
366# List of members which are set dynamically and missed by pylint inference
367# system, and so shouldn't trigger E1101 when accessed. Python regular
368# expressions are accepted.
Alexei Frolovbbf164c2019-12-16 12:51:59 -0800369generated-members=descriptor_pb2.*,plugin_pb2.*
Wyatt Heplerb627b412019-11-27 09:41:25 -0800370
371# Tells whether missing members accessed in mixin class should be ignored. A
372# mixin class is detected if its name ends with "mixin" (case insensitive).
373ignore-mixin-members=yes
374
375# Tells whether to warn about missing members when the owner of the attribute
376# is inferred to be None.
377ignore-none=yes
378
379# This flag controls whether pylint should warn about no-member and similar
380# checks whenever an opaque object is returned when inferring. The inference
381# can return multiple potential results while evaluating a Python object, but
382# some branches might not be evaluated, which results in partial inference. In
383# that case, it might be useful to still emit no-member and other checks for
384# the rest of the inferred objects.
385ignore-on-opaque-inference=yes
386
387# List of class names for which member attributes should not be checked (useful
388# for classes with dynamically set attributes). This supports the use of
389# qualified names.
Alexei Frolov7b8528e2020-01-03 10:02:26 -0800390ignored-classes=optparse.Values,
391 thread._local,
392 _thread._local,
Alexei Frolov38cad0c2020-12-03 12:36:24 -0800393 pw_cli.envparse.EnvNamespace
Wyatt Heplerb627b412019-11-27 09:41:25 -0800394
395# List of module names for which member attributes should not be checked
396# (useful for modules/projects where namespaces are manipulated during runtime
397# and thus existing member attributes cannot be deduced by static analysis). It
398# supports qualified module names, as well as Unix pattern matching.
Alexei Frolov38cad0c2020-12-03 12:36:24 -0800399ignored-modules=*_pb2
Wyatt Heplerb627b412019-11-27 09:41:25 -0800400
401# Show a hint with possible names when a member name was not found. The aspect
402# of finding the hint is based on edit distance.
403missing-member-hint=yes
404
405# The minimum edit distance a name should have in order to be considered a
406# similar match for a missing member name.
407missing-member-hint-distance=1
408
409# The total number of similar names that should be taken in consideration when
410# showing a hint for a missing member.
411missing-member-max-choices=1
412
413# List of decorators that change the signature of a decorated function.
414signature-mutators=
415
416
417[DESIGN]
418
419# Maximum number of arguments for function / method.
420max-args=10
421
422# Maximum number of attributes for a class (see R0902).
423max-attributes=11
424
425# Maximum number of boolean expressions in an if statement (see R0916).
426max-bool-expr=5
427
428# Maximum number of branch for function / method body.
429max-branches=25
430
431# Maximum number of locals for function / method body.
432max-locals=25
433
434# Maximum number of parents for a class (see R0901).
435max-parents=7
436
437# Maximum number of public methods for a class (see R0904).
438max-public-methods=25
439
440# Maximum number of return / yield for function / method body.
441max-returns=10
442
443# Maximum number of statements in function / method body.
444max-statements=100
445
446# Minimum number of public methods for a class (see R0903).
Wyatt Hepler5cfde332020-06-30 08:53:44 -0700447min-public-methods=0
Wyatt Heplerb627b412019-11-27 09:41:25 -0800448
449
450[CLASSES]
451
452# List of method names used to declare (i.e. assign) instance attributes.
453defining-attr-methods=__init__,
454 __new__,
455 setUp,
456 __post_init__
457
458# List of member names, which should be excluded from the protected access
459# warning.
460exclude-protected=_asdict,
461 _fields,
462 _replace,
463 _source,
464 _make
465
466# List of valid names for the first argument in a class method.
467valid-classmethod-first-arg=cls
468
469# List of valid names for the first argument in a metaclass class method.
470valid-metaclass-classmethod-first-arg=cls
471
472
473[IMPORTS]
474
475# List of modules that can be imported at any level, not just the top level
476# one.
477allow-any-import-level=
478
479# Allow wildcard imports from modules that define __all__.
480allow-wildcard-with-all=no
481
482# Analyse import fallback blocks. This can be used to support both Python 2 and
483# 3 compatible code, which means that the block might have code that exists
484# only in one or another interpreter, leading to false positives when analysed.
485analyse-fallback-blocks=no
486
487# Deprecated modules which should not be used, separated by a comma.
488deprecated-modules=optparse,tkinter.tix
489
490# Create a graph of external dependencies in the given file (report RP0402 must
491# not be disabled).
492ext-import-graph=
493
494# Create a graph of every (i.e. internal and external) dependencies in the
495# given file (report RP0402 must not be disabled).
496import-graph=
497
498# Create a graph of internal dependencies in the given file (report RP0402 must
499# not be disabled).
500int-import-graph=
501
502# Force import order to recognize a module as part of the standard
503# compatibility libraries.
504known-standard-library=
505
506# Force import order to recognize a module as part of a third party library.
507known-third-party=enchant
508
509# Couples of modules and preferred modules, separated by a comma.
510preferred-modules=
511
512
513[EXCEPTIONS]
514
515# Exceptions that will emit a warning when being caught. Defaults to
516# "BaseException, Exception".
517overgeneral-exceptions=BaseException,
518 Exception