Add zuul check and gate jobs to this new repo

This job adds a single linters tox target.

The linters target is an aggregation of linters for
this repo including:
 - bashate

Other linters such as yamllint can be added to this
repo by later commits.

Change-Id: Ic3608094592001a4a7dbb2e4cf4aaa81740d41a6
Story: 2006166
Task: 36540
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey 2019-09-09 14:01:28 -05:00
parent 374263e26a
commit de46fd8434
5 changed files with 49 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.tox

8
.zuul.yaml Normal file
View File

@ -0,0 +1,8 @@
---
- project:
check:
jobs:
- openstack-tox-linters
gate:
jobs:
- openstack-tox-linters

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
# Nothing

3
test-requirements.txt Normal file
View File

@ -0,0 +1,3 @@
# hacking pulls in flake8
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
bashate >= 0.2

36
tox.ini Normal file
View File

@ -0,0 +1,36 @@
[tox]
envlist = linters
minversion = 2.3
skipsdist = True
sitepackages=False
[testenv]
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_DEBUG=1
OS_LOG_CAPTURE=1
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals =
bash
[testenv:bashate]
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
# xargs -r handles empty input
commands =
bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
-name \*.sh \
-print0 | xargs -r -n 1 -0 bashate -v \
-e 'E*'"
[testenv:linters]
commands =
{[testenv:bashate]commands}