Mention autopep8 in Hacking.rst
The scripts in the tools now is able to distinguish, the autopep8 error codes better. Change-Id: I9ea19009118ed418e3666fad45d2e0eb676204c8
This commit is contained in:
parent
89733c6ac3
commit
c07edb5f80
@ -28,6 +28,8 @@ Tempest Specific Commandments
|
|||||||
- [T117] Check negative tests have ``@decorators.attr(type=['negative'])``
|
- [T117] Check negative tests have ``@decorators.attr(type=['negative'])``
|
||||||
applied.
|
applied.
|
||||||
|
|
||||||
|
It is recommended to use ``tox -eautopep8`` before submitting a patch.
|
||||||
|
|
||||||
Test Data/Configuration
|
Test Data/Configuration
|
||||||
-----------------------
|
-----------------------
|
||||||
- Assume nothing about existing test data
|
- Assume nothing about existing test data
|
||||||
|
@ -1,5 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cd $(dirname "$(readlink -f "$0")")
|
cd $(dirname "$(readlink -f "$0")")
|
||||||
|
|
||||||
autopep8 --exit-code --max-line-length=79 --experimental --in-place -r ../tempest ../setup.py && echo Formatting was not needed. >&2
|
AUTOPEP8=`which autopep8 2>/dev/null`
|
||||||
|
|
||||||
|
if [[ -z "$AUTOPEP8" ]]; then
|
||||||
|
AUTOPEP8=`which autopep8-3`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$AUTOPEP8" ]]; then
|
||||||
|
echo "Unable to locate autopep8" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# isort is not compatible with the default flake8 (H306), maybe flake8-isort
|
||||||
|
# isort -rc -sl -fss ../tempest ../setup.py
|
||||||
|
$AUTOPEP8 --exit-code --max-line-length=79 --experimental --in-place -r ../tempest ../setup.py
|
||||||
|
ERROR=$?
|
||||||
|
|
||||||
|
if [[ $ERROR -eq 0 ]]; then
|
||||||
|
echo "Formatting was not needed." >&2
|
||||||
|
exit 0
|
||||||
|
elif [[ $ERROR -eq 1 ]]; then
|
||||||
|
echo "Formatting failed.." >&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "done" >&2
|
||||||
|
fi
|
||||||
|
4
tox.ini
4
tox.ini
@ -198,7 +198,7 @@ whitelist_externals = rm
|
|||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps =
|
deps =
|
||||||
-r test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
autopep8
|
autopep8
|
||||||
basepython = python3
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
@ -210,7 +210,7 @@ commands =
|
|||||||
deps = autopep8
|
deps = autopep8
|
||||||
basepython = python3
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
autopep8 --max-line-length=79 --experimental --in-place -r tempest setup.py
|
{toxinidir}/tools/format.sh
|
||||||
|
|
||||||
[testenv:uuidgen]
|
[testenv:uuidgen]
|
||||||
commands =
|
commands =
|
||||||
|
Loading…
Reference in New Issue
Block a user