Add a linters tox environment

The linters tox environment will run yamllint and flake8.

Also fix a few trivial issues so the new target passes

Change-Id: Ifa1e9379f7d1d1996f2cfb84233bce8b502979bb
This commit is contained in:
Tony Breeds 2016-09-07 14:57:20 +10:00
parent 033f72c4a1
commit df4eb69e66
5 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,4 @@
---
- {'date': '2016-09-12T00:00', 'name': 'PTL nomination starts'}
- {'date': '2016-09-18T23:45', 'name': 'PTL nomination ends'}
- {'date': '2016-09-19T00:00', 'name': 'PTL elections begins'}

View File

@ -4,3 +4,5 @@
# needed for doc build
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
flake8>=2.5.4,<2.6.0 # MIT
yamllint

View File

@ -40,4 +40,5 @@ for project in project_list + ["TC"]:
open("%s/.placeholder" % dpath, "w").close()
print "[+] Created %s" % dpath
print "Done. Now please manually update events.yaml and doc/source/index.rst substitutions"
print("Done. Now please manually update events.yaml and "
"doc/source/index.rst substitutions")

View File

@ -2,7 +2,7 @@
import sys
sys.path.append("doc/source/_exts")
from candidates import build_candidates_list
from candidates import build_candidates_list # noqa: E402
GIT_BASE = 'http://git.openstack.org/cgit/openstack/election/plain/'

View File

@ -1,5 +1,5 @@
[tox]
envlist = docs
envlist = docs,linters
minversion = 1.6
skipsdist = True
@ -10,8 +10,15 @@ setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:linters]
commands = yamllint events.yaml
flake8
[testenv:venv]
commands = {posargs}
[testenv:docs]
commands = python setup.py build_sphinx
[flake8]
exclude=.tox,doc/source/conf.py