Skip to content

Commit 053305c

Browse files
committed
Modernize lintrc
1 parent 5e61c88 commit 053305c

File tree

1 file changed

+85
-105
lines changed

1 file changed

+85
-105
lines changed

.pylint.rc

Lines changed: 85 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,31 @@
33
# A comma-separated list of package or module names from where C extensions may
44
# be loaded. Extensions are loading into the active Python interpreter and may
55
# run arbitrary code.
6+
extension-pkg-allow-list=
7+
8+
# A comma-separated list of package or module names from where C extensions may
9+
# be loaded. Extensions are loading into the active Python interpreter and may
10+
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
11+
# for backward compatibility.)
612
extension-pkg-whitelist=
713

8-
# Add files or directories to the blacklist. They should be base names, not
9-
# paths.
14+
# Return non-zero exit code if any of these messages/categories are detected,
15+
# even if score is above --fail-under value. Syntax same as enable. Messages
16+
# specified are enabled, while categories only check already-enabled messages.
17+
fail-on=
18+
19+
# Specify a score threshold to be exceeded before program exits with error.
20+
fail-under=10.0
21+
22+
# Files or directories to be skipped. They should be base names, not paths.
1023
ignore=CVS, parser, docs, test
1124

12-
# Add files or directories matching the regex patterns to the blacklist. The
13-
# regex matches against base names, not paths.
25+
# Add files or directories matching the regex patterns to the ignore-list. The
26+
# regex matches against paths.
27+
ignore-paths=
28+
29+
# Files or directories matching the regex patterns are skipped. The regex
30+
# matches against base names, not paths.
1431
ignore-patterns=
1532

1633
# Python code to execute, usually for sys.path manipulation such as
@@ -33,9 +50,6 @@ load-plugins=
3350
# Pickle collected data for later comparisons.
3451
persistent=yes
3552

36-
# Specify a configuration file.
37-
#rcfile=
38-
3953
# When enabled, pylint would attempt to guess common misconfiguration and emit
4054
# user-friendly hints instead of false-positive error messages.
4155
suggestion-mode=yes
@@ -61,94 +75,31 @@ confidence=
6175
# no Warning level messages displayed, use "--disable=all --enable=classes
6276
# --disable=W".
6377
disable=
64-
parameter-unpacking,
65-
unpacking-in-except,
66-
backtick,
67-
long-suffix,
68-
import-star-module-level,
69-
raw-checker-failed,
70-
bad-inline-option,
71-
locally-disabled,
72-
locally-enabled,
73-
file-ignored,
74-
suppressed-message,
75-
useless-suppression,
76-
deprecated-pragma,
77-
apply-builtin,
78-
basestring-builtin,
79-
buffer-builtin,
80-
cmp-builtin,
81-
coerce-builtin,
82-
execfile-builtin,
83-
file-builtin,
84-
long-builtin,
85-
raw_input-builtin,
86-
reduce-builtin,
87-
standarderror-builtin,
88-
unicode-builtin,
89-
xrange-builtin,
90-
coerce-method,
91-
delslice-method,
92-
getslice-method,
93-
setslice-method,
94-
no-absolute-import,
95-
dict-iter-method,
96-
dict-view-method,
97-
next-method-called,
98-
metaclass-assignment,
99-
indexing-exception,
100-
raising-string,
101-
reload-builtin,
102-
oct-method,
103-
hex-method,
104-
nonzero-method,
105-
cmp-method,
106-
input-builtin,
107-
round-builtin,
108-
intern-builtin,
109-
unichr-builtin,
110-
map-builtin-not-iterating,
111-
zip-builtin-not-iterating,
112-
range-builtin-not-iterating,
113-
filter-builtin-not-iterating,
114-
using-cmp-argument,
115-
eq-without-hash,
116-
div-method,
117-
idiv-method,
118-
rdiv-method,
119-
exception-message-attribute,
120-
invalid-str-codec,
121-
sys-max-int,
122-
bad-python3-import,
123-
12478
# Disable for now during development
12579
fixme,
12680

12781
# User ignored limits
82+
too-many-lines,
12883
too-many-locals,
12984
too-many-branches,
13085
too-many-return-statements,
13186
too-few-public-methods,
13287
too-many-public-methods,
13388
too-many-statements,
13489
too-many-instance-attributes,
90+
too-many-function-args,
13591
line-too-long,
13692

137-
useless-return,
93+
# Noise / Don't care
13894
no-else-return,
139-
inconsistent-return-statements,
140-
cyclic-import,
141-
no-self-use,
14295
unused-variable,
143-
144-
bad-continuation,
14596
invalid-name,
14697
missing-docstring,
147-
148-
unidiomatic-typecheck,
14998
abstract-method,
15099
protected-access,
151-
ungrouped-imports
100+
duplicate-code,
101+
unused-argument,
102+
consider-using-f-string
152103

153104
# Enable the message, report, category or checker with the given id(s). You can
154105
# either give multiple identifier separated by comma (,) or put this option
@@ -179,7 +130,7 @@ output-format=text
179130
reports=no
180131

181132
# Activate the evaluation score.
182-
score=yes
133+
score=no
183134

184135

185136
[REFACTORING]
@@ -191,14 +142,17 @@ max-nested-blocks=5
191142
# inconsistent-return-statements if a never returning function is called then
192143
# it will be considered as an explicit return statement and no message will be
193144
# printed.
194-
never-returning-functions=sys.exit
145+
never-returning-functions=sys.exit,argparse.parse_error
195146

196147

197148
[STRING]
198149

199-
# This flag controls whether the implicit-str-concat-in-sequence should
200-
# generate a warning on implicit string concatenation in sequences defined over
201-
# several lines.
150+
# This flag controls whether inconsistent-quotes generates a warning when the
151+
# character used as a quote delimiter is used inconsistently within a module.
152+
check-quote-consistency=no
153+
154+
# This flag controls whether the implicit-str-concat should generate a warning
155+
# on implicit string concatenation in sequences defined over several lines.
202156
check-str-concat-over-line-jumps=no
203157

204158

@@ -207,10 +161,14 @@ check-str-concat-over-line-jumps=no
207161
# Limits count of emitted suggestions for spelling mistakes.
208162
max-spelling-suggestions=4
209163

210-
# Spelling dictionary name. Available dictionaries: none. To make it work,
211-
# install the python-enchant package.
164+
# Spelling dictionary name. Available dictionaries: en_GB (aspell), en_AU
165+
# (aspell), en_US (hunspell), en (aspell), en_CA (aspell).
212166
spelling-dict=
213167

168+
# List of comma separated words that should be considered directives if they
169+
# appear and the beginning of a comment and should not be checked.
170+
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
171+
214172
# List of comma separated words that should not be checked.
215173
spelling-ignore-words=
216174

@@ -224,8 +182,8 @@ spelling-store-unknown-words=no
224182

225183
[LOGGING]
226184

227-
# Format style used to check logging format string. `old` means using %
228-
# formatting, `new` is for `{}` formatting,and `fstr` is for f-strings.
185+
# The type of string formatting that logging methods do. `old` means using %
186+
# formatting, `new` is for `{}` formatting.
229187
logging-format-style=old
230188

231189
# Logging modules to check that the string format arguments are in logging
@@ -242,6 +200,9 @@ additional-builtins=
242200
# Tells whether unused global variables should be treated as a violation.
243201
allow-global-unused-variables=yes
244202

203+
# List of names allowed to shadow builtins
204+
allowed-redefined-builtins=
205+
245206
# List of strings which can identify a callback function by name. A callback
246207
# name must start or end with one of those strings.
247208
callbacks=cb_,
@@ -265,15 +226,18 @@ redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
265226

266227
[SIMILARITIES]
267228

268-
# Ignore comments when computing similarities.
229+
# Comments are removed from the similarity computation
269230
ignore-comments=yes
270231

271-
# Ignore docstrings when computing similarities.
232+
# Docstrings are removed from the similarity computation
272233
ignore-docstrings=yes
273234

274-
# Ignore imports when computing similarities.
235+
# Imports are removed from the similarity computation
275236
ignore-imports=no
276237

238+
# Signatures are removed from the similarity computation
239+
ignore-signatures=no
240+
277241
# Minimum lines number of a similarity.
278242
min-similarity-lines=10
279243

@@ -354,13 +318,6 @@ max-line-length=110
354318
# Maximum number of lines in a module.
355319
max-module-lines=2000
356320

357-
# List of optional constructs for which whitespace checking is disabled. `dict-
358-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
359-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
360-
# `empty-line` allows space-only lines.
361-
no-space-check=trailing-comma,
362-
dict-separator
363-
364321
# Allow the body of a class to be on the same line as the declaration if body
365322
# contains single statement.
366323
single-line-class-stmt=no
@@ -402,13 +359,24 @@ bad-names=foo,
402359
tutu,
403360
tata
404361

362+
# Bad variable names regexes, separated by a comma. If names match any regex,
363+
# they will always be refused
364+
bad-names-rgxs=
365+
405366
# Naming style matching correct class attribute names.
406367
class-attribute-naming-style=any
407368

408369
# Regular expression matching correct class attribute names. Overrides class-
409370
# attribute-naming-style.
410371
#class-attribute-rgx=
411372

373+
# Naming style matching correct class constant names.
374+
class-const-naming-style=UPPER_CASE
375+
376+
# Regular expression matching correct class constant names. Overrides class-
377+
# const-naming-style.
378+
#class-const-rgx=
379+
412380
# Naming style matching correct class names.
413381
class-naming-style=PascalCase
414382

@@ -442,6 +410,10 @@ good-names=i,
442410
Run,
443411
_
444412

413+
# Good variable names regexes, separated by a comma. If names match any regex,
414+
# they will always be accepted
415+
good-names-rgxs=
416+
445417
# Include a hint for the correct naming format with invalid-name.
446418
include-naming-hint=no
447419

@@ -489,6 +461,9 @@ variable-naming-style=snake_case
489461

490462
[CLASSES]
491463

464+
# Warn about protected attribute access inside special methods
465+
check-protected-access-in-special-methods=no
466+
492467
# List of method names used to declare (i.e. assign) instance attributes.
493468
defining-attr-methods=__init__,
494469
__new__,
@@ -512,8 +487,12 @@ valid-metaclass-classmethod-first-arg=cls
512487

513488
[DESIGN]
514489

490+
# List of qualified class names to ignore when countint class parents (see
491+
# R0901)
492+
ignored-parents=
493+
515494
# Maximum number of arguments for function / method.
516-
max-args=8
495+
max-args=16
517496

518497
# Maximum number of attributes for a class (see R0902).
519498
max-attributes=7
@@ -558,18 +537,19 @@ allow-wildcard-with-all=no
558537
analyse-fallback-blocks=no
559538

560539
# Deprecated modules which should not be used, separated by a comma.
561-
deprecated-modules=optparse,tkinter.tix
540+
deprecated-modules=
562541

563-
# Create a graph of external dependencies in the given file (report RP0402 must
564-
# not be disabled).
542+
# Output a graph (.gv or any supported image format) of external dependencies
543+
# to the given file (report RP0402 must not be disabled).
565544
ext-import-graph=
566545

567-
# Create a graph of every (i.e. internal and external) dependencies in the
568-
# given file (report RP0402 must not be disabled).
546+
# Output a graph (.gv or any supported image format) of all (i.e. internal and
547+
# external) dependencies to the given file (report RP0402 must not be
548+
# disabled).
569549
import-graph=
570550

571-
# Create a graph of internal dependencies in the given file (report RP0402 must
572-
# not be disabled).
551+
# Output a graph (.gv or any supported image format) of internal dependencies
552+
# to the given file (report RP0402 must not be disabled).
573553
int-import-graph=
574554

575555
# Force import order to recognize a module as part of the standard
@@ -587,5 +567,5 @@ preferred-modules=
587567

588568
# Exceptions that will emit a warning when being caught. Defaults to
589569
# "BaseException, Exception".
590-
overgeneral-exceptions=BaseException,
591-
Exception
570+
overgeneral-exceptions=builtin.BaseException,
571+
builtin.Exception

0 commit comments

Comments
 (0)