From cef733eba25e3a700b61208bc155f1efcf083a08 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman <rjeffman@redhat.com> Date: Wed, 9 Dec 2020 12:09:00 -0300 Subject: [PATCH] covscan error[SC2068]: Fix unquoted array expansions. error[SC2068]: Double quote array expansions to avoid re-splitting elements. --- utils/lint_check.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/utils/lint_check.sh b/utils/lint_check.sh index 49700266..eba2c1d5 100755 --- a/utils/lint_check.sh +++ b/utils/lint_check.sh @@ -1,6 +1,6 @@ #!/bin/bash -topdir=`dirname $(dirname $0)` +topdir="`dirname $(dirname $0)`" flake8 . pydocstyle . @@ -11,15 +11,18 @@ ANSIBLE_MODULE_UTILS=${ANSIBLE_MODULE_UTILS:-"${topdir}/plugins/module_utils"} export ANSIBLE_LIBRARY ANSIBLE_MODULE_UTILS yaml_dirs=( - "${topdir}/tests/*.yml" - "${topdir}/tests/*/*.yml" - "${topdir}/tests/*/*/*.yml" - "${topdir}/playbooks/*.yml" - "${topdir}/playbooks/*/*.yml" - "${topdir}/molecule/*/*.yml" - "${topdir}/molecule/*/*/*.yml" + "${topdir}/tests" + "${topdir}/playbooks" + "${topdir}/molecule" ) -ansible-lint --force-color ${yaml_dirs[@]} +for dir in "${yaml_dirs[@]}" +do + find "${dir}" -type f -name "*.yml" | xargs ansible-lint --force-color +done -yamllint -f colored ${yaml_dirs[@]} + +for dir in "${yaml_dirs[@]}" +do + find "${dir}" -type f -name "*.yml" | xargs yamllint +done -- GitLab