|
| 1 | +# .shellcheckrc - Pi-Router + NAS Server shellcheck config |
| 2 | +# Multi-Device Setup: 552 Shell-Scripts (Pi 5: ~249, NAS: ~303) |
| 3 | +# Best Practices 2025 compliant |
| 4 | +# Optimized for ShellCheck 0.9.0+ (Last reviewed: 12. Dezember 2025) |
| 5 | +# |
| 6 | +# References: |
| 7 | +# - https://www.shellcheck.net/wiki/Directive |
| 8 | +# - https://www.shellcheck.net/wiki/Optional |
| 9 | +# - https://man.archlinux.org/man/extra/shellcheck/shellcheck.1.en |
| 10 | + |
| 11 | +# ============================================================================ |
| 12 | +# DISABLED CHECKS |
| 13 | +# ============================================================================ |
| 14 | + |
| 15 | +# SC1090: Can't follow non-constant source |
| 16 | +# SC1091: Not following sourced file |
| 17 | +# Rationale: Scripts use dynamic library paths (e.g., ${SCRIPT_DIR}/../lib/) |
| 18 | +# shellcheck cannot resolve these at static analysis time |
| 19 | +# Example: source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/../lib/logging.sh" |
| 20 | +disable=SC1090,SC1091 |
| 21 | + |
| 22 | +# ============================================================================ |
| 23 | +# OPTIONAL CHECKS |
| 24 | +# ============================================================================ |
| 25 | + |
| 26 | +# NOT using enable=all (Best Practice 2025) |
| 27 | +# Reason: enable=all activates subjective/conflicting optional checks |
| 28 | +# meant for discovery only, not production |
| 29 | +# Instead: Selectively enable specific optional checks if needed |
| 30 | +# |
| 31 | +# Available optional checks (use shellcheck --list-optional): |
| 32 | +# - avoid-nullary-conditions, deprecate-which, quote-safe-variables, etc. |
| 33 | + |
| 34 | +# No optional checks enabled (Production default) |
| 35 | + |
| 36 | +# ============================================================================ |
| 37 | +# CONFIGURATION |
| 38 | +# ============================================================================ |
| 39 | + |
| 40 | +# Shell dialect (Raspberry Pi OS Bookworm: bash 5.2.15, Ubuntu 24.04: bash 5.2.21) |
| 41 | +shell=bash |
| 42 | + |
| 43 | +# Source path for library resolution |
| 44 | +# SCRIPTDIR = directory of currently checked script |
| 45 | +source-path=SCRIPTDIR |
| 46 | + |
| 47 | +# Allow following source statements (Best Practice 2025) |
| 48 | +# Safely enables shellcheck to open sourced files where possible |
| 49 | +external-sources=true |
| 50 | + |
| 51 | +# Minimum severity threshold (focus on errors + warnings) |
| 52 | +# Consistent with script-audit.sh Production-Ready threshold (85%+ clean) |
| 53 | +severity=warning |
0 commit comments