mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
- Adds `make lint-shell`. uses local `shellcheck` if its version matches, otherwise runs the pinned image via docker or podman - `.shellcheckrc` disables the most annoying rules - Fixes findings across existing scripts Fixes: #37648 Signed-off-by: silverwind <[email protected]> Co-authored-by: Claude (Opus 4.7) <[email protected]> Co-authored-by: TheFox0x7 <[email protected]> Co-authored-by: Nicolas <[email protected]>
12 lines
389 B
Bash
Executable File
12 lines
389 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-docker}"
|
|
VERSION=$(echo "$SHELLCHECK_IMAGE" | sed -E 's/.*:v([0-9.]+)@.*/\1/')
|
|
|
|
if hash shellcheck 2>/dev/null && shellcheck --version | grep -qx "version: $VERSION"; then
|
|
exec shellcheck --color=always "$@"
|
|
else
|
|
exec "$CONTAINER_RUNTIME" run --rm -v "$PWD":/mnt -w /mnt "$SHELLCHECK_IMAGE" --color=always "$@"
|
|
fi
|