Skip to content
koalaman edited this page Aug 17, 2015 · 9 revisions

This source will be skipped since it's not constant.

Problematic code:

source "$1/lib.sh"

Correct code:

# shellcheck disable=SC1090
source "$1/lib.sh"

Rationale:

ShellCheck is not able to include sourced files from non-constant paths.

Instead, be aware that anything in the sourced file will be ignored, and then disable the message.

Exceptions:

Ignore the message with a directive.

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally