summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2016-12-09 14:40:43 -0500
committerRussell Teague <rteague@redhat.com>2016-12-12 13:54:24 -0500
commitbe97433dd559a3bdae4baedda20a7f17bd47450b (patch)
tree6f89b1ec06c19a9de87a5d1108d8ba9b6f069f34 /utils
parentbf3fa6162880e2dff9c23d42ceb2197e071ba570 (diff)
downloadopenshift-be97433dd559a3bdae4baedda20a7f17bd47450b.tar.gz
openshift-be97433dd559a3bdae4baedda20a7f17bd47450b.tar.bz2
openshift-be97433dd559a3bdae4baedda20a7f17bd47450b.tar.xz
openshift-be97433dd559a3bdae4baedda20a7f17bd47450b.zip
YAML Linting
* Added checks to make ci for yaml linting * Modified y(a)ml files to pass lint checks
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile16
-rw-r--r--utils/test-requirements.txt1
2 files changed, 14 insertions, 3 deletions
diff --git a/utils/Makefile b/utils/Makefile
index ad6735cb5..c061edd8c 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -32,6 +32,10 @@ ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
MANPAGES := docs/man/man1/atomic-openshift-installer.1
VERSION := 1.3
+# YAMLFILES: Skipping all '/files/' folders due to conflicting yaml file definitions
+YAMLFILES = $(shell find ../ -name $(VENV) -prune -o \( -name '*.yml' -o -name '*.yaml' \) ! -path "*/files/*" 2>&1)
+PYFILES = $(shell find ../ -name $(VENV) -prune -o -name ooinstall.egg-info -prune -o -name test -prune -o -name "*.py" -print)
+
sdist: clean
python setup.py sdist
rm -fR $(SHORTNAME).egg-info
@@ -86,7 +90,13 @@ ci-pylint: $(VENV)
@echo "#############################################"
@echo "# Running PyLint Tests in virtualenv"
@echo "#############################################"
- . $(VENV)/bin/activate && python -m pylint --rcfile ../git/.pylintrc $(shell find ../ -name $(VENV) -prune -o -name ooinstall.egg-info -prune -o -name test -prune -o -name "*.py" -print)
+ . $(VENV)/bin/activate && python -m pylint --rcfile ../git/.pylintrc $(PYFILES)
+
+ci-yamllint: $(VENV)
+ @echo "#############################################"
+ @echo "# Running yamllint Tests in virtualenv"
+ @echo "#############################################"
+ @. $(VENV)/bin/activate && yamllint -c ../git/.yamllint $(YAMLFILES)
ci-list-deps: $(VENV)
@echo "#############################################"
@@ -101,9 +111,9 @@ ci-flake8: $(VENV)
. $(VENV)/bin/activate && flake8 --config=setup.cfg ../ --exclude="utils,../inventory"
. $(VENV)/bin/activate && python setup.py flake8
-ci: ci-list-deps ci-unittests ci-flake8 ci-pylint
+ci: ci-list-deps ci-unittests ci-flake8 ci-pylint ci-yamllint
@echo
@echo "##################################################################################"
@echo "VIEW CODE COVERAGE REPORT WITH 'xdg-open cover/index.html' or run 'make viewcover'"
@echo "To clean your test environment run 'make clean'"
- @echo "Other targets you may run with 'make': 'ci-pylint', 'ci-unittests', 'ci-flake8'"
+ @echo "Other targets you may run with 'make': 'ci-pylint', 'ci-unittests', 'ci-flake8', 'ci-yamllint'"
diff --git a/utils/test-requirements.txt b/utils/test-requirements.txt
index eeaf106ec..b70a03563 100644
--- a/utils/test-requirements.txt
+++ b/utils/test-requirements.txt
@@ -10,3 +10,4 @@ PyYAML
click
backports.functools_lru_cache
pyOpenSSL
+yamllint