## .shellcheckrc
# https://github.com/koalaman/shellcheck/blob/4e703e5c61/shellcheck.1.md#options
#
# look for 'source'd files relative to the checked script,
# and also look for absolute paths in /mnt/chroot
source-path=SCRIPTDIR

shell=sh

# allow opening any 'source'd file, even if not specified as input
external-sources=true

# suggest removing unnecessary comparison negations `[ ! "$var" -eq 1 ]`
enable=avoid-negated-conditions
# suggest explicitly using -n in `[ $var ]`
enable=avoid-nullary-conditions
# check for additional cases where exit codes are masked
enable=check-extra-masked-returns
# notify when set -e is suppressed during function invocation
enable=check-set-e-suppressed
# warn when uppercase variables are unassigned
enable=check-unassigned-uppercase
# suggest `command -v` instead of `which`
enable=deprecate-which
# suggest quoting variables without metacharacters
enable=quote-safe-variables

# useless cat.
disable=SC2002
# consider using pgrep instead of grepping ps output.
disable=SC2009
# only supports sh/bash/dash/ksh => allow conforming shells besides sh/bash/ksh/dash
disable=SC1071
# cant follow non-constant source. use a directive to specify location.
# disable=SC1090
# not following => allow linking to, but not following, linked scripts
disable=SC1091
# allow [ ] instead of [[ ]] for tests in bash/ksh
disable=SC2292
# see: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/read.html#tag_20_100_04
disable=SC3045
