From 51017785538b0447b78e6f6ed5f912c0c6b76eae Mon Sep 17 00:00:00 2001 From: KingPoo Date: Tue, 3 Jan 2017 04:03:58 -0500 Subject: [PATCH] Add YAMLLint for static check JIRA: OCTO-160 1)Install yamllint first in case pod didn't install. If installed, it would info "already satisfied". 2)delete virtualenv of releng_yamllint. Current CI commit gate is simple, just have flake8 check in part of projects, it's better to apply more check tools to more projects. Yaml files could be checked by YAMLLint when the project is configed in releng. YAMLLint does not only check for syntax validity, but for weirdnesses like key repetition and cosmetic problems such as lines length, trailing spaces, indentation, etc. Change-Id: I8591385ed32942e0af7f7afdde435313af5707e5 Signed-off-by: KingPoo --- jjb/global/releng-macros.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index 7647a35d3..5b7ef5065 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -366,6 +366,9 @@ set -o xtrace export PATH=$PATH:/usr/local/bin/ + # install python packages + pip install "yamllint==1.6.0" + # generate and upload lint log echo "Running yaml code on $PROJECT ..." @@ -375,8 +378,6 @@ # Get number of yaml violations. If none, this will be an # empty string: "" find . \ - -path './releng_yamllint' -prune -o \ - -path './.tox' -prune -o \ -type f -name "*.yml" -print \ -o -name "*.yaml" -print | \ xargs yamllint > yaml-violation.log || true -- 2.16.6