Add shellcheck lint and bats tests

make lint runs shellcheck on every tracked bash script, make test runs
the bats suite in tests/, and make check runs both. The tests cover the
update orchestrator (hook isolation, failure reporting, pull and
free-space handling) and utils.sh (migrations, package install and
removal, services, initramfs build check), using stub commands so they
never touch the real system.

Fixes from the first lint run: 20-aur.sh stops if a cd fails rather
than building or deleting in the wrong directory, and
80-gnome-extensions.sh refuses to rm -rf with an empty path. The rest
are false positives, silenced in .shellcheckrc or per line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 16:15:12 -06:00
co-authored by Claude Opus 5.5
parent 7e08a048ca
commit d9da8208dd
16 changed files with 464 additions and 12 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
#!/bin/bash
# configure reads TITLE and DESCRIPTION
# shellcheck disable=SC2034
TITLE="Federated Computer Core"
# shellcheck disable=SC2034
DESCRIPTION="Superpanel, Nextcloud, email, files and Element"
# Each Core is in cores/<domain>.conf, with what you entered last time, so
@@ -309,7 +312,7 @@ step() {
# can't be reached.
ask_password() {
local tries
for tries in 1 2 3; do
for _ in 1 2 3; do
read -rsp "Your Core password: " PASSWORD
echo
if [ -n "$1" ]; then nextcloud_app_password "$1"; else nextcloud_sign_in; fi
@@ -381,7 +384,7 @@ change_password() {
local tries reached=1
load_core "$1"
STATUS=0
for tries in 1 2 3; do
for _ in 1 2 3; do
read -rsp "Your new Core password: " PASSWORD
echo
nextcloud_sign_in