Convert linters from tox to nox

This expands the noxfile to include the linters session and switches
the tox-linters job with the nox-linters job.

Change-Id: If5ff34aded40c66667eaa468baea10fb2658e2b3
This commit is contained in:
Michael Kelly 2023-02-24 20:52:12 -08:00
parent b653e6e20a
commit c6b7308c68
No known key found for this signature in database
GPG Key ID: 77F7FE93040ECF3E
3 changed files with 19 additions and 2 deletions

View File

@ -97,14 +97,14 @@
- project:
check:
jobs:
- tox-linters
- nox-linters
- zuul-nox-docs
- zuul-operator-build-image
- zuul-operator-functional-k8s:
dependencies: zuul-operator-build-image
gate:
jobs:
- tox-linters
- nox-linters
- zuul-nox-docs
- zuul-operator-upload-image
- zuul-operator-functional-k8s:

View File

@ -45,3 +45,10 @@ def docs(session):
session.install('-e', '.')
session.run('sphinx-build', '-E', '-W', '-d', 'doc/build/doctrees',
'-b', 'html', 'doc/source/', 'doc/build/html')
@nox.session(python='3')
def linters(session):
set_standard_env_vars(session)
session.install('flake8')
session.run('flake8')

View File

@ -58,3 +58,13 @@ source-dir = doc/source
build-dir = doc/build
all_files = 1
warning-is-error = 1
[flake8]
# These are ignored intentionally in openstack-infra projects;
# please don't submit patches that solely correct them or enable them.
ignore = E124,E125,E129,E252,E402,E741,H,W503,W504
show-source = True
exclude = .venv,.nox,.tox,dist,doc,build,*.egg
per-file-ignores =
# Allow import * to create a superset of objects
zuul_operator/objects.py:F403,F405