diff --git a/.pylintrc b/.pylintrc index cee0c978489..28706a4a12d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,9 +1,17 @@ # The format of this file isn't really documented; just use --generate-rcfile -[MASTER] +[MAIN] # Add 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 diff --git a/tox.ini b/tox.ini index 7029bfc2382..7349abd5358 100644 --- a/tox.ini +++ b/tox.ini @@ -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