Add ShellCheck

Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser
2025-08-04 21:13:09 +02:00
parent 80d57935b6
commit 08e88bda24
3 changed files with 27 additions and 5 deletions

21
.github/workflows/shellcheck.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: ShellCheck
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
shellcheck:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
-
name: Checkout repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0 # Differential ShellCheck requires full git history
- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@v5
with:
severity: warning
display-engine: sarif-fmt

6
.shellcheckrc Normal file
View File

@@ -0,0 +1,6 @@
external-sources=true # allow shellcheck to read external sources
disable=SC3043 #disable SC3043: In POSIX sh, local is undefined.
enable=useless-use-of-cat # disabled by default as of shellcheck 0.11.0
enable=avoid-negated-conditions # avoid-negated-conditions is optional as of shellcheck 0.11.0
enable=require-variable-braces
enable=deprecate-which

View File

@@ -1,9 +1,4 @@
#!/usr/bin/env sh
# shellcheck disable=SC1091
# Ignore warning about `local` being undefinded in POSIX
# shellcheck disable=SC3043
# https://github.com/koalaman/shellcheck/wiki/SC3043#exceptions
# PADD
# A more advanced version of the chronometer provided with Pihole