From 51997927f2642f5198ae820462ec9de8e6cfe016 Mon Sep 17 00:00:00 2001 From: Hamed Sanaei Date: Tue, 27 Oct 2026 10:32:47 +0330 Subject: [PATCH] fix(ci): support runner ShellCheck diagnostics for indirect calls Ubuntu 24.04 ships ShellCheck 0.9.0, which reports SC2317 for the EXIT cleanup and dynamically loaded installer test stubs. Scope both old and new diagnostic annotations to those indirect functions and regenerate both standalone scripts. Verified all shell checks and rootless regressions on the runner version as well as ShellCheck 0.11.0. --- install.sh | 3 ++- scripts/lib/ip-ssl.sh | 3 ++- scripts/test/ip-ssl-entrypoint-test.sh | 4 ++-- x-ui.sh | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 243fdcedf..386283f09 100644 --- a/install.sh +++ b/install.sh @@ -301,7 +301,8 @@ ip_ssl_issue_and_install() ( umask 077 mkdir -p "$cert_dir" || return 1 stage=$(mktemp -d "$cert_dir/.xui-install.XXXXXX") || return 1 - # shellcheck disable=SC2329 + # Invoked indirectly by the EXIT trap; older ShellCheck reports SC2317. + # shellcheck disable=SC2317,SC2329 ip_ssl_install_cleanup() { restored=1 if ((attempted && !installed)); then diff --git a/scripts/lib/ip-ssl.sh b/scripts/lib/ip-ssl.sh index 1946639a7..5d3635036 100644 --- a/scripts/lib/ip-ssl.sh +++ b/scripts/lib/ip-ssl.sh @@ -244,7 +244,8 @@ ip_ssl_issue_and_install() ( umask 077 mkdir -p "$cert_dir" || return 1 stage=$(mktemp -d "$cert_dir/.xui-install.XXXXXX") || return 1 - # shellcheck disable=SC2329 + # Invoked indirectly by the EXIT trap; older ShellCheck reports SC2317. + # shellcheck disable=SC2317,SC2329 ip_ssl_install_cleanup() { restored=1 if ((attempted && !installed)); then diff --git a/scripts/test/ip-ssl-entrypoint-test.sh b/scripts/test/ip-ssl-entrypoint-test.sh index f28a528fc..895c0409e 100644 --- a/scripts/test/ip-ssl-entrypoint-test.sh +++ b/scripts/test/ip-ssl-entrypoint-test.sh @@ -12,9 +12,9 @@ source /dev/stdin < <(awk '/^# BEGIN GENERATED IP SSL HELPERS/ {block=1;next} /^ source_function "$ROOT/install.sh" prompt_or_default source_function "$ROOT/install.sh" prompt_and_setup_ssl # Invoked by the real installer function loaded above, before the failure stubs. -# shellcheck disable=SC2329 +# shellcheck disable=SC2317,SC2329 setup_ip_certificate() { captured="${2:-}"; called=1; } -# shellcheck disable=SC2329 +# shellcheck disable=SC2317,SC2329 systemctl() { stopped=1; } export NONINTERACTIVE=1 XUI_SSL_MODE=ip XUI_SSL_IPV6='not:ipv6' called=0; stopped=0 diff --git a/x-ui.sh b/x-ui.sh index 5ec286f47..c9d084f79 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -287,7 +287,8 @@ ip_ssl_issue_and_install() ( umask 077 mkdir -p "$cert_dir" || return 1 stage=$(mktemp -d "$cert_dir/.xui-install.XXXXXX") || return 1 - # shellcheck disable=SC2329 + # Invoked indirectly by the EXIT trap; older ShellCheck reports SC2317. + # shellcheck disable=SC2317,SC2329 ip_ssl_install_cleanup() { restored=1 if ((attempted && !installed)); then