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