Merge pull request #9741 from GabyCT/topic/staticcheck

tests: Fix indentation in static checks script
This commit is contained in:
GabyCT 2024-06-03 09:43:23 -06:00 committed by GitHub
commit 6c7affbd85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -188,36 +188,36 @@ EOF
# Calls die() if the specified function is not valid. # Calls die() if the specified function is not valid.
func_is_valid() { func_is_valid() {
local name="$1" local name="$1"
type -t "$name" &>/dev/null || die "function '$name' does not exist" type -t "$name" &>/dev/null || die "function '$name' does not exist"
} }
# Calls die() if the specified function is not valid or not a check function. # Calls die() if the specified function is not valid or not a check function.
ensure_func_is_check_func() { ensure_func_is_check_func() {
local name="$1" local name="$1"
func_is_valid "$name" func_is_valid "$name"
{ echo "$name" | grep -q "${check_func_regex}"; ret=$?; } { echo "$name" | grep -q "${check_func_regex}"; ret=$?; }
[ "$ret" = 0 ] || die "function '$name' is not a check function" [ "$ret" = 0 ] || die "function '$name' is not a check function"
} }
# Returns "yes" if the specified function needs to run on all architectures, # Returns "yes" if the specified function needs to run on all architectures,
# else "no". # else "no".
func_is_arch_specific() { func_is_arch_specific() {
local name="$1" local name="$1"
ensure_func_is_check_func "$name" ensure_func_is_check_func "$name"
{ echo "$name" | grep -q "${arch_func_regex}"; ret=$?; } { echo "$name" | grep -q "${arch_func_regex}"; ret=$?; }
if [ "$ret" = 0 ]; then if [ "$ret" = 0 ]; then
echo "yes" echo "yes"
else else
echo "no" echo "no"
fi fi
} }
function remove_tmp_files() { function remove_tmp_files() {