From 6c1bcb7f02e4159bef21154341a9268f38bce438 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Wed, 27 Jun 2018 11:23:48 +0200 Subject: ci: Support for pylint and yamllint A support for pylint and yamllint checks was introduced. Checks can be executed manually by invocation of ./check script (see script usage for more details). Automatic lint checks were integrated info VERIFY and MERGE job bodies. TODO: Improve pylint ratings of python code. Some issues can be fixed in python files or by relaxing pylint settings. However dependencies on ONAP includes can't be easily fixed. Thus pylint checks should be set as non-blocking at the beginning. Change-Id: I82a6a266b8003ae5d70f4f2a88ecc96817b97ac0 Signed-off-by: Martin Klozik --- ci/build-auto.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'ci/build-auto.sh') diff --git a/ci/build-auto.sh b/ci/build-auto.sh index 611d83a..96588b9 100755 --- a/ci/build-auto.sh +++ b/ci/build-auto.sh @@ -30,12 +30,23 @@ # EXIT=0 EXIT_UNKNOWN_JOB_TYPE=1 +EXIT_LINT_FAILED=2 # # configuration # AUTOENV_DIR="$HOME/autoenv" +# +# functions +# +# execute pylint and yamllint to check code quality +function execute_auto_lint_check() { + if ! ./check -b ; then + EXIT=$EXIT_LINT_FAILED + fi +} + # # main # @@ -69,7 +80,7 @@ case $1 in # Example of verify job body. Functions can call # external scripts, etc. - #execute_auto_pylint_check + execute_auto_lint_check #execute_auto_doc_check #install_opnfv MCP #install_onap @@ -87,14 +98,14 @@ case $1 in # Example of merge job body. Functions can call # external scripts, etc. - #execute_auto_pylint_check + execute_auto_lint_check #execute_auto_doc_check #install_opnfv MCP #install_onap #execute_sanity_check #execute_tests $1 - # Everything went well, so report SUCCESS to Jenkins + # propagate result to the Jenkins job exit $EXIT ;; "daily") @@ -111,7 +122,7 @@ case $1 in #execute_tests $1 #push_results_and_logs_to_artifactory - # Everything went well, so report SUCCESS to Jenkins + # propagate result to the Jenkins job exit $EXIT ;; *) -- cgit 1.2.3-korg