You've already forked docker-mailserver
mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-07 23:03:10 +02:00
first refactoring fr *.bats according to shellcheck
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user