summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-11-08 23:54:03 +0000
committerGerrit Code Review <review@openstack.org>2021-11-08 23:54:03 +0000
commit0e0196d979cf1b8e63b9656358116a36f1f09ede (patch)
tree2f255c25fb6d085a0113cd548bbb6771cbb3660b /tox.ini
parentc62616963aeefa4e090fca8eca15417210b99215 (diff)
parentf3d48000b139ec38d92da276a43a8387f76cbc89 (diff)
downloadnova-0e0196d979cf1b8e63b9656358116a36f1f09ede.tar.gz
Merge "Add autopep8 to tox and pre-commit"
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini15
1 files changed, 15 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
index 1f38faf68e..c03b9a8c9a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -47,14 +47,29 @@ commands =
description =
Run style checks.
envdir = {toxworkdir}/shared
+deps =
+ {[testenv]deps}
+ autopep8
commands =
{[testenv:mypy]commands}
+ # check if autopep8 would alter the formatting but don't actually change it
+ # so we can gate on this in the ci
+ autopep8 --exit-code --max-line-length=79 --diff -r nova doc setup.py
+ # since autopep8 only tries to make minimal changes to conform to pep8 we still need to run
+ # our hacking and flake8 check to keep our existing code style consistent.
+ # The full list of issues addressable by autopep8 can be found here
+ # https://pypi.org/project/autopep8/#features
bash tools/flake8wrap.sh {posargs}
# Check that all JSON files don't have \r\n in line.
bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
# Check that all included JSON files are valid JSON
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
+[testenv:autopep8]
+deps = autopep8
+commands =
+ autopep8 --exit-code --max-line-length=79 --in-place -r nova doc setup.py
+
[testenv:fast8]
description =
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'