From c913d42c39e7ec19bebac3e5a2b7849d0a7cb2b7 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 22 May 2017 16:50:20 -0400 Subject: [PATCH] Run ansible-lint under pep8 envlist Start linting our ansible playbooks, this is helpful to find basic syntax / formatting errors. Change-Id: I147a303841ac70ee59177c56d24758e73c04205b Signed-off-by: Paul Belanger --- test-requirements.txt | 1 + tox.ini | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index d6676fe7..5d53074a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ hacking>=0.12.0,<0.13 # Apache-2.0 +ansible-lint bashate>=0.2 sphinx>=1.5.1,<1.6.0 # BSD oslosphinx>=4.7.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 9046fc4d..7afd70be 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,11 @@ commands = bindep test commands = python setup.py build_sphinx [testenv:pep8] -commands = flake8 {posargs} +whitelist_externals = bash +commands = + flake8 {posargs} + bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \ + ansible-lint" [testenv:venv] commands = {posargs}