pre-commit: Use local neutron hacking checks
This patch requires a new neutron-lib release (3.21.1) containing the depends on one. Change-Id: I880dc9e7f0d3cd578168e5c1435275901fc68f1f Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/956353
This commit is contained in:
@@ -42,7 +42,7 @@ repos:
|
|||||||
rev: 7.0.0
|
rev: 7.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: hacking
|
- id: hacking
|
||||||
additional_dependencies: ['neutron', 'neutron-lib']
|
additional_dependencies: ['neutron-lib>=3.21.1']
|
||||||
exclude: '^(doc|releasenotes|tools)/.*$'
|
exclude: '^(doc|releasenotes|tools)/.*$'
|
||||||
- repo: https://github.com/hhatto/autopep8
|
- repo: https://github.com/hhatto/autopep8
|
||||||
rev: v2.3.2
|
rev: v2.3.2
|
||||||
|
@@ -15,7 +15,7 @@ requests>=2.32.3 # Apache-2.0
|
|||||||
Jinja2>=2.10 # BSD License (3 clause)
|
Jinja2>=2.10 # BSD License (3 clause)
|
||||||
keystonemiddleware>=5.1.0 # Apache-2.0
|
keystonemiddleware>=5.1.0 # Apache-2.0
|
||||||
netaddr>=0.7.18 # BSD
|
netaddr>=0.7.18 # BSD
|
||||||
neutron-lib>=3.21.0 # Apache-2.0
|
neutron-lib>=3.21.1 # Apache-2.0
|
||||||
python-neutronclient>=7.8.0 # Apache-2.0
|
python-neutronclient>=7.8.0 # Apache-2.0
|
||||||
tenacity>=6.0.0 # Apache-2.0
|
tenacity>=6.0.0 # Apache-2.0
|
||||||
SQLAlchemy>=1.4.23 # MIT
|
SQLAlchemy>=1.4.23 # MIT
|
||||||
|
46
tox.ini
46
tox.ini
@@ -208,37 +208,33 @@ select = H,N
|
|||||||
# H204: Use assert(Not)Equal to check for equality
|
# H204: Use assert(Not)Equal to check for equality
|
||||||
# H205: Use assert(Greater|Less)(Equal) for comparison
|
# H205: Use assert(Greater|Less)(Equal) for comparison
|
||||||
# H904: Delay string interpolations at logging calls
|
# H904: Delay string interpolations at logging calls
|
||||||
enable-extensions = H106,H203,H204,H205,H904
|
# N521: jsonutils must be used instead of json
|
||||||
|
# N524: Use of contextlib.nested is deprecated
|
||||||
|
# N529: Method's default argument shouldn't be mutable
|
||||||
|
# N530: Direct neutron imports not allowed
|
||||||
|
# N535: Usage of Python eventlet module not allowed
|
||||||
|
# N536: Use assertIsNone
|
||||||
|
enable-extensions = H106,H203,H204,H205,H904,N521,N524,N529,N530,N532,N534,N535,N536
|
||||||
ignore = H405,H701,H702,H703,N530,N535
|
ignore = H405,H701,H702,H703,N530,N535
|
||||||
show-source = true
|
show-source = true
|
||||||
exclude = ./.*,build,dist,doc
|
exclude = ./.*,build,dist,doc
|
||||||
|
|
||||||
[flake8:local-plugins]
|
[flake8:local-plugins]
|
||||||
extension =
|
extension =
|
||||||
# Checks specific to neutron repo
|
N322 = checks:check_assert_called_once_with
|
||||||
N322 = neutron.hacking.checks:check_assert_called_once_with
|
N328 = checks:check_asserttruefalse
|
||||||
N328 = neutron.hacking.checks:check_asserttruefalse
|
N329 = checks:check_assertitemsequal
|
||||||
N329 = neutron.hacking.checks:check_assertitemsequal
|
N330 = checks:check_assertempty
|
||||||
N330 = neutron.hacking.checks:check_assertempty
|
N332 = checks:check_assertequal_for_httpcode
|
||||||
N332 = neutron.hacking.checks:check_assertequal_for_httpcode
|
N340 = checks:check_oslo_i18n_wrapper
|
||||||
N340 = neutron.hacking.checks:check_oslo_i18n_wrapper
|
N341 = checks:check_builtins_gettext
|
||||||
N341 = neutron.hacking.checks:check_builtins_gettext
|
N343 = checks:check_no_imports_from_tests
|
||||||
N343 = neutron.hacking.checks:check_no_imports_from_tests
|
N344 = checks:check_python3_no_filter
|
||||||
N344 = neutron.hacking.checks:check_python3_no_filter
|
N346 = checks:check_no_sqlalchemy_event_import
|
||||||
N346 = neutron.hacking.checks:check_no_sqlalchemy_event_import
|
N348 = checks:check_no_import_six
|
||||||
N348 = neutron.hacking.checks:check_no_import_six
|
N349 = checks:check_no_import_packaging
|
||||||
N349 = neutron.hacking.checks:check_no_import_packaging
|
N350 = checks:check_no_sqlalchemy_lazy_subquery
|
||||||
N350 = neutron.hacking.checks:check_no_sqlalchemy_lazy_subquery
|
paths = ./neutron/hacking
|
||||||
# Checks from neutron-lib
|
|
||||||
N521 = neutron_lib.hacking.checks:use_jsonutils
|
|
||||||
N524 = neutron_lib.hacking.checks:check_no_contextlib_nested
|
|
||||||
N529 = neutron_lib.hacking.checks:no_mutable_default_args
|
|
||||||
N530 = neutron_lib.hacking.checks:check_neutron_namespace_imports
|
|
||||||
N532 = neutron_lib.hacking.translation_checks:check_log_warn_deprecated
|
|
||||||
N534 = neutron_lib.hacking.translation_checks:check_raised_localized_exceptions
|
|
||||||
N535 = neutron_lib.hacking.checks:check_no_eventlet_imports
|
|
||||||
N536 = neutron_lib.hacking.checks:assert_equal_none
|
|
||||||
N537 = neutron_lib.hacking.translation_checks:no_translate_logs
|
|
||||||
|
|
||||||
[doc8]
|
[doc8]
|
||||||
max-line-length = 79
|
max-line-length = 79
|
||||||
|
Reference in New Issue
Block a user