Updated SC1090 (markdown)

koalaman
2015-08-19 18:43:35 -07:00
parent 3775f87583
commit a1d88a4801

@@ -1,20 +1,20 @@
## This source will be skipped since it's not constant.
## Can't follow non-constant source. Use a directive to specify location.
### Problematic code:
source "$1/lib.sh"
. "$(find_install_dir)/lib.sh"
### Correct code:
# shellcheck disable=SC1090
source "$1/lib.sh"
# shellcheck source=src/lib.sh
. "$(find_install_dir)/lib.sh"
### Rationale:
ShellCheck is not able to include sourced files from non-constant paths.
ShellCheck is not able to include sourced files from paths that are determined at runtime. The file will not be read, potentially resulting in warnings about unassigned variables and similar.
Instead, be aware that anything in the sourced file will be ignored, and then disable the message.
Use a [[Directive]] to point shellcheck to a fixed location it can read instead.
### Exceptions:
Ignore the message with a [[directive]].
If you don't care that ShellCheck is unable to account for the file, specify `# shellcheck source=/dev/null`.