diff --git a/.zuul.yaml b/.zuul.yaml index 5941f54..88166eb 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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: diff --git a/noxfile.py b/noxfile.py index d8be906..4ce4440 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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') diff --git a/setup.cfg b/setup.cfg index 7b6711d..e53cea3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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