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