Add maintenante/shfmt.sh for shell script formatting

Thanks @selfhoster1312 <3
This commit is contained in:
Salamandar 2024-08-31 12:02:01 +02:00 committed by Salamandar
parent b91e9dd8f4
commit 68f35831e7

16
maintenance/shfmt.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -Eeuo pipefail
shfmt_args=(
--indent 4
--keep-padding # keep column alignment paddings
--space-redirects # redirect operators will be followed by a space
--binary-next-line # binary ops like && and | may start a line
--case-indent # switch cases will be indented
)
shfmt "${shfmt_args[@]}" "$@" \
helpers/helpers \
helpers/helpers.v2.1.d/* \
helpers/helpers.v2.d/* \
hooks/*