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