Bump hacking

... because hacking 3.0.x is too old. pylint is also bumped to resolve
conflicting dependencies. The new version is currently used in neutron.
The pylint setting is imported from neutron with one additional
disablement to ignore the following error.

ovsdbapp/schema/open_vswitch/helpers.py:47:14: R1732: Consider using
'with' for resource-allocating operations (consider-using-with)

Change-Id: I41b4524ff13b8d46d2e0c76f09b5ec47601bd955
This commit is contained in:
Takashi Kajinami 2024-01-27 23:13:16 +09:00
parent 1cb9acc015
commit e62823d134
4 changed files with 62 additions and 38 deletions

View File

@ -1,49 +1,85 @@
# The format of this file isn't really documented; just use --generate-rcfile # 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 # Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times. # path. You may set this option multiple times.
ignore=.git,tests 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] [MESSAGES CONTROL]
# TODO: This list is copied from neutron, the options which do not need to be # NOTE(gus): This is a long list. A number of these are important and
# suppressed have been already removed, some of the remaining options will be # should be re-enabled once the offending code is fixed (or marked
# removed by code adjustment. # with a local disable)
disable= disable=
# "F" Fatal errors that prevent further processing # "F" Fatal errors that prevent further processing
import-error, import-error,
# "I" Informational noise # "I" Informational noise
c-extension-no-member,
locally-disabled,
# "E" Error for important programming issues (likely bugs) # "E" Error for important programming issues (likely bugs)
access-member-before-definition,
no-member, no-member,
no-method-argument,
no-self-argument,
not-an-iterable,
# "W" Warnings for stylistic problems or minor programming issues # "W" Warnings for stylistic problems or minor programming issues
abstract-method, abstract-method,
arguments-differ, arguments-differ,
attribute-defined-outside-init, attribute-defined-outside-init,
bad-indentation,
broad-except, broad-except,
dangerous-default-value, dangerous-default-value,
expression-not-assigned,
fixme, fixme,
global-statement, global-statement,
no-init, keyword-arg-before-vararg,
literal-comparison,
non-parent-init-called,
not-callable,
protected-access, protected-access,
redefined-builtin, redefined-builtin,
redefined-outer-name, redefined-outer-name,
signature-differs, signature-differs,
super-init-not-called,
unpacking-non-sequence,
unused-argument, unused-argument,
unused-import, unused-import,
unused-variable, unused-variable,
useless-super-delegation, useless-super-delegation,
unnecessary-pass,
raise-missing-from,
arguments-renamed,
broad-exception-raised,
unspecified-encoding,
redundant-u-string-prefix,
unused-private-member,
# "C" Coding convention violations # "C" Coding convention violations
bad-continuation, consider-iterating-dictionary,
consider-using-enumerate,
invalid-name, invalid-name,
len-as-condition, len-as-condition,
misplaced-comparison-constant,
missing-docstring, missing-docstring,
singleton-comparison,
superfluous-parens, superfluous-parens,
ungrouped-imports, ungrouped-imports,
wrong-import-order, wrong-import-order,
consider-using-f-string,
consider-using-dict-items,
# "R" Refactor recommendations # "R" Refactor recommendations
consider-merging-isinstance,
consider-using-ternary,
duplicate-code, duplicate-code,
inconsistent-return-statements,
no-else-return, no-else-return,
no-self-use, no-self-use,
redefined-argument-from-local,
simplifiable-if-statement,
too-few-public-methods, too-few-public-methods,
too-many-ancestors, too-many-ancestors,
too-many-arguments, too-many-arguments,
@ -51,22 +87,15 @@ disable=
too-many-instance-attributes, too-many-instance-attributes,
too-many-lines, too-many-lines,
too-many-locals, too-many-locals,
too-many-nested-blocks,
too-many-public-methods, too-many-public-methods,
too-many-return-statements, too-many-return-statements,
too-many-statements, too-many-statements,
inconsistent-return-statements,
useless-object-inheritance,
too-many-nested-blocks,
too-many-boolean-expressions,
not-callable,
# new for python3 version of pylint
chained-comparison,
consider-using-dict-comprehension,
consider-using-in,
consider-using-set-comprehension, consider-using-set-comprehension,
unnecessary-pass, useless-object-inheritance,
useless-object-inheritance super-with-arguments,
use-dict-literal,
consider-using-with
[BASIC] [BASIC]
# Variable names can be 1 to 31 characters long, with lowercase and underscores # Variable names can be 1 to 31 characters long, with lowercase and underscores
@ -79,8 +108,8 @@ argument-rgx=[a-z_][a-z0-9_]{1,30}$
# and be lowercased with underscores # and be lowercased with underscores
method-rgx=([a-z_][a-z0-9_]{2,}|setUp|tearDown)$ method-rgx=([a-z_][a-z0-9_]{2,}|setUp|tearDown)$
# Module names matching # Module names matching neutron-* are ok (files in bin/)
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(neutron-[a-z0-9_-]+))$
# Don't require docstrings on tests. # Don't require docstrings on tests.
no-docstring-rgx=((__.*__)|([tT]est.*)|setUp|tearDown)$ no-docstring-rgx=((__.*__)|([tT]est.*)|setUp|tearDown)$
@ -92,23 +121,27 @@ max-line-length=79
[VARIABLES] [VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that # List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible. # you should avoid to define new builtins when possible.
additional-builtins= # _ is used by our localization
additional-builtins=_
[CLASSES] [CLASSES]
# List of interface methods to ignore, separated by a comma. # List of valid names for the first argument in a class method.
ignore-iface-methods= valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=cls
[IMPORTS] [IMPORTS]
# Deprecated modules which should not be used, separated by a comma # Deprecated modules which should not be used, separated by a comma
deprecated-modules= deprecated-modules=
# should use oslo_serialization.jsonutils # should use oslo_serialization.jsonutils
json json,
six
[TYPECHECK] [TYPECHECK]
# List of module names for which member attributes should not be checked # List of module names for which member attributes should not be checked
ignored-modules=six.moves,_MovedItems ignored-modules=_MovedItems
[REPORTS] [REPORTS]
# Tells whether to display a full report or only the messages # Tells whether to display a full report or only the messages
reports=no reports=no

View File

@ -1,11 +1,6 @@
# Requirements lower bounds listed here are our best effort to keep them up to # Requirements lower bounds listed here are our best effort to keep them up to
# date but we do not test them so no guarantee of having them all correct. If # date but we do not test them so no guarantee of having them all correct. If
# you find any incorrect lower bounds, let us know or propose a fix. # you find any incorrect lower bounds, let us know or propose a fix.
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
netaddr>=0.7.18 # BSD netaddr>=0.7.18 # BSD
ovs>=2.10.0 # Apache-2.0 ovs>=2.10.0 # Apache-2.0

View File

@ -1,7 +1,3 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
isort==4.3.21 # MIT isort==4.3.21 # MIT
python-subunit>=1.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD

View File

@ -18,7 +18,7 @@ deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
hacking>=3.0.1,<3.1.0 # Apache-2.0 hacking>=6.1.0,<6.2.0 # Apache-2.0
commands = stestr run --slowest {posargs} commands = stestr run --slowest {posargs}
[testenv:pep8] [testenv:pep8]
@ -26,7 +26,7 @@ commands = flake8
bash {toxinidir}/tools/coding-checks.sh --all '{posargs}' bash {toxinidir}/tools/coding-checks.sh --all '{posargs}'
deps = deps =
{[testenv]deps} {[testenv]deps}
pylint==2.5.3 # GPLv2 pylint==2.17.4 # GPLv2
allowlist_externals = bash allowlist_externals = bash
[testenv:venv] [testenv:venv]