2018-08-31 00:39:24 +02:00
|
|
|
#!/bin/sh -e
|
2023-01-26 08:40:14 +01:00
|
|
|
# Copyright 2023 Oliver Smith
|
2018-08-31 00:39:24 +02:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2022-10-30 15:33:51 +01:00
|
|
|
# Description: lint all shell scripts
|
2022-11-20 16:36:28 +01:00
|
|
|
# https://postmarketos.org/pmb-ci
|
2018-08-31 00:39:24 +02:00
|
|
|
|
2022-10-30 15:33:51 +01:00
|
|
|
DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
|
2018-08-31 00:39:24 +02:00
|
|
|
|
2022-10-30 15:33:51 +01:00
|
|
|
if [ "$(id -u)" = 0 ]; then
|
|
|
|
set -x
|
|
|
|
apk -q add shellcheck
|
|
|
|
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
2018-08-31 00:39:24 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Shell: shellcheck
|
|
|
|
sh_files="
|
2021-05-24 07:26:28 +02:00
|
|
|
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
|
2020-11-10 12:38:43 +01:00
|
|
|
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
|
2023-07-15 13:06:54 -07:00
|
|
|
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh
|
2021-10-10 02:00:41 +03:00
|
|
|
./main/postmarketos-installkernel/installkernel-pmos
|
2023-02-17 14:29:10 -08:00
|
|
|
./main/postmarketos-initramfs/init.sh
|
|
|
|
./main/postmarketos-initramfs/init_functions.sh
|
2018-08-31 00:39:24 +02:00
|
|
|
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
|
2023-11-17 11:30:00 +01:00
|
|
|
./main/postmarketos-mkinitfs-hook-debug-shell/setup_usb_storage.sh
|
2021-06-04 18:57:45 +03:00
|
|
|
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
|
2021-07-04 20:59:15 +01:00
|
|
|
./main/ttyescape/*.post-install
|
2022-01-22 19:14:26 +01:00
|
|
|
./main/unl0kr/unlock.sh
|
2021-08-04 16:05:49 +05:00
|
|
|
./main/msm-firmware-loader/*.post-install
|
2022-11-23 13:04:28 -06:00
|
|
|
./device/community/soc-qcom-sdm845/call_audio_idle_suspend_workaround.sh
|
2019-10-31 12:19:39 +01:00
|
|
|
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.sh')
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.pre-install')
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.post-install')
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.pre-upgrade')
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.post-upgrade')
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.pre-deinstall')
|
|
|
|
$(find . -path './main/postmarketos-ui-*/*.post-deinstall')
|
|
|
|
|
2018-08-31 00:39:24 +02:00
|
|
|
$(find . -name '*.trigger')
|
|
|
|
$(find . -path './main/devicepkg-dev/*.sh')
|
2020-11-12 10:08:56 +01:00
|
|
|
$(find . -path './main/postmarketos-mvcfg/*.sh')
|
2018-08-31 00:39:24 +02:00
|
|
|
|
2023-03-16 22:12:43 +01:00
|
|
|
$(find . -path './.ci/**.sh')
|
2018-08-31 00:39:24 +02:00
|
|
|
"
|
2022-10-30 15:33:51 +01:00
|
|
|
|
2019-10-31 12:19:39 +01:00
|
|
|
for file in $sh_files; do
|
2018-08-31 00:39:24 +02:00
|
|
|
echo "Test with shellcheck: $file"
|
2022-10-30 15:33:51 +01:00
|
|
|
cd "$DIR/$(dirname "$file")"
|
2023-08-20 14:28:36 -07:00
|
|
|
shellcheck -e SC1008 -e SC3043 -x "$(basename "$file")"
|
2018-08-31 00:39:24 +02:00
|
|
|
done
|