Update pylint version

It has been over 2 years since we set the version of
pylint and associated tools in tox.ini, update to
something newer, specifically:

  bashate>=2.1.1
  bandit>=1.7.5
  flake8-import-order==0.18.2
  pylint==2.17.4

This required disabling additional checks for new
warnings that were found, and adding a directive to
add the "no-self-use" plugin that is now required
with the newer version.

Will work on fixing new warnings and re-enabling
checks in subsequent patches.

Trivialfix

Change-Id: I5d74d47ac1d8a085b447ff531d7abbecfb4cce6e
This commit is contained in:
Brian Haley 2023-04-26 17:28:42 -04:00
parent b600498232
commit ed274efcf7
2 changed files with 42 additions and 8 deletions

View File

@ -1,9 +1,17 @@
# The format of this file isn't really documented; just use --generate-rcfile
[MASTER]
[MAIN]
# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
ignore=.git,tests
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint.extensions.no_self_use
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
[MESSAGES CONTROL]
# NOTE(gus): This is a long list. A number of these are important and
# should be re-enabled once the offending code is fixed (or marked
@ -20,6 +28,9 @@ disable=
no-method-argument,
no-self-argument,
not-an-iterable,
unsubscriptable-object,
unsupported-delete-operation,
used-before-assignment,
# "W" Warnings for stylistic problems or minor programming issues
abstract-method,
arguments-differ,
@ -44,6 +55,17 @@ disable=
unused-import,
unused-variable,
useless-super-delegation,
unnecessary-pass,
raise-missing-from,
arguments-renamed,
broad-exception-raised,
modified-iterating-list,
unspecified-encoding,
missing-timeout,
implicit-str-concat,
redundant-u-string-prefix,
unused-private-member,
global-variable-not-assigned,
# "C" Coding convention violations
consider-iterating-dictionary,
consider-using-enumerate,
@ -54,6 +76,11 @@ disable=
superfluous-parens,
ungrouped-imports,
wrong-import-order,
consider-using-f-string,
consider-using-dict-items,
use-implicit-booleaness-not-comparison,
use-maxsplit-arg,
unnecessary-dunder-call,
# "R" Refactor recommendations
consider-merging-isinstance,
consider-using-ternary,
@ -74,10 +101,17 @@ disable=
too-many-public-methods,
too-many-return-statements,
too-many-statements,
# new for python3 version of pylint
consider-using-set-comprehension,
unnecessary-pass,
useless-object-inheritance
useless-object-inheritance,
use-a-generator,
unnecessary-lambda-assignment,
super-with-arguments,
consider-using-max-builtin,
use-dict-literal,
consider-using-generator,
consider-using-in,
use-list-literal,
consider-using-from-import
[BASIC]
# Variable names can be 1 to 31 characters long, with lowercase and underscores

View File

@ -117,10 +117,10 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
envdir = {toxworkdir}/lint
deps =
{[testenv]deps}
bashate>=0.5.1 # Apache-2.0
bandit!=1.6.0,>=1.1.0 # Apache-2.0
flake8-import-order==0.18.1 # LGPLv3
pylint==2.5.3 # GPLv2
bashate>=2.1.1 # Apache-2.0
bandit>=1.7.5 # Apache-2.0
flake8-import-order==0.18.2 # LGPLv3
pylint==2.17.4 # GPLv2
commands=
# If it is easier to add a check via a shell script, consider adding it in this file
bash ./tools/misc-sanity-checks.sh