Add YAMLLint for static check 59/26659/1
authorKingPoo <haojingbo@huawei.com>
Tue, 3 Jan 2017 09:03:58 +0000 (04:03 -0500)
committerKingPoo <haojingbo@huawei.com>
Tue, 3 Jan 2017 09:03:58 +0000 (04:03 -0500)
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 <haojingbo@huawei.com>
jjb/global/releng-macros.yml

index 7647a35..5b7ef50 100644 (file)
             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 ..."
 
             # 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