mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 17:44:49 +02:00
first refactoring fr *.bats according to shellcheck
This commit is contained in:
parent
46998dd816
commit
9ce719213b
31 changed files with 141 additions and 134 deletions
|
@ -90,7 +90,7 @@ function _eclint
|
|||
return 102
|
||||
fi
|
||||
|
||||
__log_info 'linter version:' "$(${LINT[0]} --version))"
|
||||
__log_info 'linter version:' "$(${LINT[0]} --version)"
|
||||
|
||||
if "${LINT[@]}"
|
||||
then
|
||||
|
@ -113,7 +113,7 @@ function _hadolint
|
|||
fi
|
||||
|
||||
__log_info 'linter version:' \
|
||||
"$(${LINT[0]} --version | grep -E -o "v[0-9\.]*"))"
|
||||
"$(${LINT[0]} --version | grep -E -o "v[0-9\.]*")"
|
||||
|
||||
if git ls-files --exclude='Dockerfile*' --ignored | \
|
||||
xargs --max-lines=1 "${LINT[@]}"
|
||||
|
@ -138,7 +138,7 @@ function _shellcheck
|
|||
fi
|
||||
|
||||
__log_info 'linter version:' \
|
||||
"$(${LINT[0]} --version | grep -m 2 -o "[0-9.]*"))"
|
||||
"$(${LINT[0]} --version | grep -m 2 -o "[0-9.]*")"
|
||||
|
||||
# an overengineered solution to allow shellcheck -x to
|
||||
# properly follow `source=<SOURCE FILE>` when sourcing
|
||||
|
@ -176,21 +176,19 @@ function _shellcheck
|
|||
done < <(find target/bin -executable -type f)
|
||||
|
||||
# the same for all test files
|
||||
# while read -r FILE
|
||||
# do
|
||||
# if ! (
|
||||
# cd "$(realpath "$(dirname "$(readlink -f "${FILE}")")")"
|
||||
# if ! "${LINT[@]}" "$(basename -- "${FILE}")"
|
||||
# then
|
||||
# return 1
|
||||
# fi
|
||||
# )
|
||||
# then
|
||||
# # ! Errors / warnings found here are
|
||||
# # ! currently NOT accounted for.
|
||||
# :
|
||||
# fi
|
||||
# done < <(find test/ -maxdepth 1 -type f -iname "*.bats")
|
||||
while read -r FILE
|
||||
do
|
||||
if ! (
|
||||
cd "$(realpath "$(dirname "$(readlink -f "${FILE}")")")"
|
||||
if ! "${LINT[@]}" "$(basename -- "${FILE}")"
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
)
|
||||
then
|
||||
ERR=1
|
||||
fi
|
||||
done < <(find test/ -maxdepth 1 -type f -iname "*.bats")
|
||||
|
||||
if [[ ERR -eq 1 ]]
|
||||
then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue