Check for oslo library usage
Occasionally oslo library usage sneaks in, so add a coding check
that checks for ^oslo\. in requirements.txt. We currently still
use oslo.test, so don't check test-requirements.txt. This should
fail to pass tests until I34357d5a594330d07f5cad372859d98efb5d3fde
merges.
Change-Id: I53108584ee47a7f1b6c7df90c49f95725cec69f9
(cherry picked from commit f4855dd66f
)
This commit is contained in:
parent
912a3a9b0e
commit
6419a2e187
14
HACKING.rst
14
HACKING.rst
|
@ -1,4 +1,14 @@
|
|||
ovsdbapp Style Commandments
|
||||
===============================================
|
||||
===========================
|
||||
|
||||
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/
|
||||
- Step 1: Read the OpenStack Style Commandments
|
||||
https://docs.openstack.org/hacking/latest/
|
||||
|
||||
- Step 2: Read on
|
||||
|
||||
ovsdbapp-specific Commandments
|
||||
------------------------------
|
||||
|
||||
- ovsdbapp is intended to be a simple wrapper on top of python-ovs. As such,
|
||||
it must build and be deployable without any OpenStack dependencies (oslo
|
||||
projects included). It does currently use oslo.test for testing.
|
||||
|
|
|
@ -27,12 +27,22 @@ process_options () {
|
|||
case $opt in
|
||||
-h|--help) usage;;
|
||||
-Y|--pylint) pylint=1;;
|
||||
-O|--oslo) oslo=1;;
|
||||
-a|--all) oslo=1; pylint=1;;
|
||||
*) join_args;;
|
||||
esac
|
||||
i=$((i+1))
|
||||
done
|
||||
}
|
||||
|
||||
run_oslo () {
|
||||
echo "Checking for oslo libraries in requirements.txt..."
|
||||
if grep -q "^oslo[.-]" requirements.txt; then
|
||||
echo "oslo libraries are not allowed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_pylint () {
|
||||
local target="${scriptargs:-all}"
|
||||
|
||||
|
@ -56,10 +66,14 @@ run_pylint () {
|
|||
}
|
||||
|
||||
scriptargs=
|
||||
pylint=1
|
||||
pylint=0
|
||||
oslo=0
|
||||
|
||||
process_options $@
|
||||
|
||||
if [ $oslo -eq 1 ]; then
|
||||
run_oslo
|
||||
fi
|
||||
if [ $pylint -eq 1 ]; then
|
||||
run_pylint
|
||||
exit 0
|
||||
|
|
4
tox.ini
4
tox.ini
|
@ -18,8 +18,8 @@ commands = stestr run --slowest {posargs}
|
|||
|
||||
[testenv:pep8]
|
||||
basepython = python2.7
|
||||
commands = flake8 {posargs}
|
||||
{toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
|
||||
commands = flake8
|
||||
{toxinidir}/tools/coding-checks.sh --all '{posargs}'
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
|
Loading…
Reference in New Issue