Files
Otavio Pontes a3c1f97c57 shellcheck: Unify shellcheck script
Make sure shellcheck and shellcheck bats are using the same configuration to
run shellcheck

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-30 08:50:48 -07:00

26 lines
466 B
Bash
Executable File

#!/usr/bin/env bats
# Author: Otavio Pontes
# Email: otavio.pontes@intel.com
@test "ANL002: Shellcheck on all files" {
local error=0
status=0
output=""
TESTS=$(find . -regex ".*\\.bats\\|.*\\.bash" | sort)
for i in $TESTS; do
echo checking "$i" >&3
run "$BATS_TEST_DIRNAME"/../../scripts/shellcheck.bash "$i"
echo "Result: $status" >&3
if [ ! "$status" -eq "0" ]; then
echo "$output" >&3
error=1
fi
echo >&3
done
[ "$error" -eq "0" ]
}