Skip to content

Commit bd4c8a6

Browse files
committed
tox: fix pylint errors
Fix pylint configuration for pylint 2.14: Unrecognized option found: no-space-check [unrecognized-option] Unknown option value for '--disable', expected a valid pylint message and got 'no-self-use' [unknown-option-value] Update requirement in tox.ini. Signed-off-by: Robin Jarry <[email protected]>
1 parent 532f768 commit bd4c8a6

File tree

3 files changed

+101
-61
lines changed

3 files changed

+101
-61
lines changed

pylintrc

Lines changed: 99 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
[MASTER]
1+
[MAIN]
22

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-whitelist=_sysrepo
7-
8-
# Add files or directories to the blacklist. They should be base names, not
9-
# paths.
10-
ignore=CVS
11-
12-
# Add files or directories matching the regex patterns to the blacklist. The
13-
# regex matches against base names, not paths.
14-
ignore-patterns=
15-
16-
# Python code to execute, usually for sys.path manipulation such as
17-
# pygtk.require().
18-
#init-hook=
6+
extension-pkg-allow-list=_sysrepo,_libyang
197

208
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
219
# number of processors available to use.
@@ -30,6 +18,10 @@ limit-inference-results=100
3018
# usually to register additional checkers.
3119
load-plugins=
3220

21+
# Minimum Python version to use for version dependent checks. Will default to
22+
# the version used to run pylint.
23+
py-version=3.6
24+
3325
# Pickle collected data for later comparisons.
3426
persistent=no
3527

@@ -61,7 +53,7 @@ enable=all
6153
# can either give multiple identifiers separated by comma (,) or put this
6254
# option multiple times (only on the command line, not in the configuration
6355
# file where it should appear only once). You can also use "--disable=all" to
64-
# disable everything first and then reenable specific checks. For example, if
56+
# disable everything first and then re-enable specific checks. For example, if
6557
# you want to run only the similarities checker, you can use "--disable=all
6658
# --enable=similarities". If you want to run only the classes checker, but have
6759
# no Warning level messages displayed, use "--disable=all --enable=classes
@@ -77,7 +69,6 @@ disable=
7769
line-too-long,
7870
locally-disabled,
7971
missing-docstring,
80-
no-self-use,
8172
suppressed-message,
8273
too-many-lines,
8374
unnecessary-pass,
@@ -120,6 +111,15 @@ max-nested-blocks=5
120111
# printed.
121112
never-returning-functions=sys.exit
122113

114+
[STRING]
115+
116+
# This flag controls whether inconsistent-quotes generates a warning when the
117+
# character used as a quote delimiter is used inconsistently within a module.
118+
check-quote-consistency=no
119+
120+
# This flag controls whether the implicit-str-concat should generate a warning
121+
# on implicit string concatenation in sequences defined over several lines.
122+
check-str-concat-over-line-jumps=no
123123

124124
[TYPECHECK]
125125

@@ -133,9 +133,11 @@ contextmanager-decorators=contextlib.contextmanager
133133
# expressions are accepted.
134134
generated-members=
135135

136-
# Tells whether missing members accessed in mixin class should be ignored. A
137-
# mixin class is detected if its name ends with "mixin" (case insensitive).
138-
ignore-mixin-members=yes
136+
# List of symbolic message names to ignore for Mixin members.
137+
ignored-checks-for-mixins=no-member,
138+
not-async-context-manager,
139+
not-context-manager,
140+
attribute-defined-outside-init
139141

140142
# Tells whether to warn about missing members when the owner of the attribute
141143
# is inferred to be None.
@@ -154,12 +156,6 @@ ignore-on-opaque-inference=yes
154156
# qualified names.
155157
ignored-classes=optparse.Values,thread._local,_thread._local
156158

157-
# List of module names for which member attributes should not be checked
158-
# (useful for modules/projects where namespaces are manipulated during runtime
159-
# and thus existing member attributes cannot be deduced by static analysis. It
160-
# supports qualified module names, as well as Unix pattern matching.
161-
ignored-modules=
162-
163159
# Show a hint with possible names when a member name was not found. The aspect
164160
# of finding the hint is based on edit distance.
165161
missing-member-hint=yes
@@ -172,6 +168,12 @@ missing-member-hint-distance=1
172168
# showing a hint for a missing member.
173169
missing-member-max-choices=1
174170

171+
# Regex pattern to define which classes are considered mixins.
172+
mixin-class-rgx=.*[Mm]ixin
173+
174+
# List of decorators that change the signature of a decorated function.
175+
signature-mutators=
176+
175177

176178
[VARIABLES]
177179

@@ -182,6 +184,9 @@ additional-builtins=
182184
# Tells whether unused global variables should be treated as a violation.
183185
allow-global-unused-variables=yes
184186

187+
# List of names allowed to shadow builtins
188+
allowed-redefined-builtins=
189+
185190
# List of strings which can identify a callback function by name. A callback
186191
# name must start or end with one of those strings.
187192
callbacks=
@@ -207,23 +212,26 @@ redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
207212

208213
[SIMILARITIES]
209214

210-
# Ignore comments when computing similarities.
215+
# Comments are removed from the similarity computation
211216
ignore-comments=yes
212217

213-
# Ignore docstrings when computing similarities.
218+
# Docstrings are removed from the similarity computation
214219
ignore-docstrings=yes
215220

216-
# Ignore imports when computing similarities.
221+
# Imports are removed from the similarity computation
217222
ignore-imports=no
218223

224+
# Signatures are removed from the similarity computation
225+
ignore-signatures=yes
226+
219227
# Minimum lines number of a similarity.
220228
min-similarity-lines=4
221229

222230

223231
[LOGGING]
224232

225-
# Format style used to check logging format string. `old` means using %
226-
# formatting, while `new` is for `{}` formatting.
233+
# The type of string formatting that logging methods do. `old` means using %
234+
# formatting, `new` is for `{}` formatting.
227235
logging-format-style=old
228236

229237
# Logging modules to check that the string format arguments are in logging
@@ -252,12 +260,6 @@ max-line-length=88
252260
# Maximum number of lines in a module.
253261
max-module-lines=1000
254262

255-
# List of optional constructs for which whitespace checking is disabled. `dict-
256-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
257-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
258-
# `empty-line` allows space-only lines.
259-
no-space-check=
260-
261263
# Allow the body of a class to be on the same line as the declaration if body
262264
# contains single statement.
263265
single-line-class-stmt=yes
@@ -273,37 +275,53 @@ single-line-if-stmt=no
273275
argument-naming-style=any
274276

275277
# Regular expression matching correct argument names. Overrides argument-
276-
# naming-style.
278+
# naming-style. If left empty, argument names will be checked with the set
279+
# naming style.
277280
#argument-rgx=
278281

279282
# Naming style matching correct attribute names.
280283
attr-naming-style=any
281284

282285
# Regular expression matching correct attribute names. Overrides attr-naming-
286+
# style. If left empty, attribute names will be checked with the set naming
283287
# style.
284288
#attr-rgx=
285289

286290
# Bad variable names which should always be refused, separated by a comma.
287291
bad-names=
288292

293+
# Bad variable names regexes, separated by a comma. If names match any regex,
294+
# they will always be refused
295+
bad-names-rgxs=
296+
289297
# Naming style matching correct class attribute names.
290298
class-attribute-naming-style=any
291299

292300
# Regular expression matching correct class attribute names. Overrides class-
293-
# attribute-naming-style.
301+
# attribute-naming-style. If left empty, class attribute names will be checked
302+
# with the set naming style.
294303
#class-attribute-rgx=
295304

305+
# Naming style matching correct class constant names.
306+
class-const-naming-style=UPPER_CASE
307+
308+
# Regular expression matching correct class constant names. Overrides class-
309+
# const-naming-style. If left empty, class constant names will be checked with
310+
# the set naming style.
311+
#class-const-rgx=
312+
296313
# Naming style matching correct class names.
297314
class-naming-style=PascalCase
298315

299316
# Regular expression matching correct class names. Overrides class-naming-
300-
# style.
317+
# style. If left empty, class names will be checked with the set naming style.
301318
#class-rgx=
302319

303320
# Naming style matching correct constant names.
304321
const-naming-style=any
305322

306323
# Regular expression matching correct constant names. Overrides const-naming-
324+
# style. If left empty, constant names will be checked with the set naming
307325
# style.
308326
#const-rgx=
309327

@@ -315,34 +333,40 @@ docstring-min-length=-1
315333
function-naming-style=snake_case
316334

317335
# Regular expression matching correct function names. Overrides function-
318-
# naming-style.
336+
# naming-style. If left empty, function names will be checked with the set
337+
# naming style.
319338
#function-rgx=
320339

321340
# Good variable names which should always be accepted, separated by a comma.
322341
good-names=
323342

343+
# Good variable names regexes, separated by a comma. If names match any regex,
344+
# they will always be accepted
345+
good-names-rgxs=
346+
324347
# Include a hint for the correct naming format with invalid-name.
325348
include-naming-hint=no
326349

327350
# Naming style matching correct inline iteration names.
328351
inlinevar-naming-style=any
329352

330353
# Regular expression matching correct inline iteration names. Overrides
331-
# inlinevar-naming-style.
354+
# inlinevar-naming-style. If left empty, inline iteration names will be checked
355+
# with the set naming style.
332356
#inlinevar-rgx=
333357

334358
# Naming style matching correct method names.
335359
method-naming-style=snake_case
336360

337361
# Regular expression matching correct method names. Overrides method-naming-
338-
# style.
362+
# style. If left empty, method names will be checked with the set naming style.
339363
#method-rgx=
340364

341365
# Naming style matching correct module names.
342366
module-naming-style=snake_case
343367

344368
# Regular expression matching correct module names. Overrides module-naming-
345-
# style.
369+
# style. If left empty, module names will be checked with the set naming style.
346370
#module-rgx=
347371

348372
# Colon-delimited sets of names that determine each other's naming style when
@@ -358,11 +382,16 @@ no-docstring-rgx=^_
358382
# These decorators are taken in consideration only for invalid-name.
359383
property-classes=abc.abstractproperty
360384

385+
# Regular expression matching correct type variable names. If left empty, type
386+
# variable names will be checked with the set naming style.
387+
#typevar-rgx=
388+
361389
# Naming style matching correct variable names.
362390
variable-naming-style=any
363391

364392
# Regular expression matching correct variable names. Overrides variable-
365-
# naming-style.
393+
# naming-style. If left empty, variable names will be checked with the set
394+
# naming style.
366395
#variable-rgx=
367396

368397

@@ -373,24 +402,30 @@ notes=FIXME,
373402
XXX,
374403
TODO
375404

405+
# Regular expression of note tags to take in consideration.
406+
notes-rgx=
376407

377408
[SPELLING]
378409

379410
# Limits count of emitted suggestions for spelling mistakes.
380411
max-spelling-suggestions=4
381412

382-
# Spelling dictionary name. Available dictionaries: none. To make it working
383-
# install python-enchant package..
413+
# Spelling dictionary name. Available dictionaries: none. To make it work,
414+
# install the 'python-enchant' package.
384415
spelling-dict=
385416

417+
# List of comma separated words that should be considered directives if they
418+
# appear at the beginning of a comment and should not be checked.
419+
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
420+
386421
# List of comma separated words that should not be checked.
387422
spelling-ignore-words=
388423

389-
# A path to a file that contains private dictionary; one word per line.
424+
# A path to a file that contains the private dictionary; one word per line.
390425
spelling-private-dict-file=
391426

392-
# Tells whether to store unknown words to indicated private dictionary in
393-
# --spelling-private-dict-file option instead of raising a message.
427+
# Tells whether to store unknown words to the private dictionary (see the
428+
# --spelling-private-dict-file option) instead of raising a message.
394429
spelling-store-unknown-words=no
395430

396431

@@ -399,24 +434,24 @@ spelling-store-unknown-words=no
399434
# Allow wildcard imports from modules that define __all__.
400435
allow-wildcard-with-all=no
401436

402-
# Analyse import fallback blocks. This can be used to support both Python 2 and
403-
# 3 compatible code, which means that the block might have code that exists
404-
# only in one or another interpreter, leading to false positives when analysed.
405-
analyse-fallback-blocks=no
437+
# List of modules that can be imported at any level, not just the top level
438+
# one.
439+
allow-any-import-level=
406440

407441
# Deprecated modules which should not be used, separated by a comma.
408442
deprecated-modules=optparse,tkinter.tix
409443

410-
# Create a graph of external dependencies in the given file (report RP0402 must
411-
# not be disabled).
444+
# Output a graph (.gv or any supported image format) of external dependencies
445+
# to the given file (report RP0402 must not be disabled).
412446
ext-import-graph=
413447

414-
# Create a graph of every (i.e. internal and external) dependencies in the
415-
# given file (report RP0402 must not be disabled).
448+
# Output a graph (.gv or any supported image format) of all (i.e. internal and
449+
# external) dependencies to the given file (report RP0402 must not be
450+
# disabled).
416451
import-graph=
417452

418-
# Create a graph of internal dependencies in the given file (report RP0402 must
419-
# not be disabled).
453+
# Output a graph (.gv or any supported image format) of internal dependencies
454+
# to the given file (report RP0402 must not be disabled).
420455
int-import-graph=
421456

422457
# Force import order to recognize a module as part of the standard
@@ -426,9 +461,14 @@ known-standard-library=
426461
# Force import order to recognize a module as part of a third party library.
427462
known-third-party=enchant
428463

464+
# Couples of modules and preferred modules, separated by a comma.
465+
preferred-modules=
429466

430467
[CLASSES]
431468

469+
# Warn about protected attribute access inside special methods
470+
check-protected-access-in-special-methods=no
471+
432472
# List of method names used to declare (i.e. assign) instance attributes.
433473
defining-attr-methods=__init__,
434474
__new__,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_version_from_archive_id(git_archive_id="$Format:%ct %d$"):
6666
See man gitattributes(5) and git-log(1) (PRETTY FORMATS) for more details.
6767
"""
6868
# mangle the magic string to make sure it is not replaced by git archive
69-
if git_archive_id.startswith("$For" "mat:"):
69+
if git_archive_id.startswith("$For" "mat:"): # pylint: disable=implicit-str-concat
7070
raise ValueError("source was not modified by git archive")
7171

7272
# source was modified by git archive, try to parse the version from

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ deps =
7575
flake8
7676
flake8-copyright
7777
isort
78-
pylint>=2.5
78+
pylint>=2.14
7979
whitelist_externals =
8080
/bin/sh
8181
/usr/bin/sh

0 commit comments

Comments
 (0)