From 762aa405f22b11c0888358e9ddb353c190e10fbc Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Wed, 19 Oct 2022 21:17:07 -0700 Subject: [PATCH] Created SC1144 (markdown) --- SC1144.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SC1144.md diff --git a/SC1144.md b/SC1144.md new file mode 100644 index 0000000..1588ad1 --- /dev/null +++ b/SC1144.md @@ -0,0 +1,26 @@ +## external-sources can only be enabled in .shellcheckrc, not in individual files. + +### Problematic code: + +```sh +# shellcheck external-sources=true +source /dev/zero +``` + +### Correct code: + +Add `external-sources=true` to `.shellcheckrc` + +### Rationale: + +Due to its origins as an online tool, ShellCheck will by default run in a sandbox where it only reads the files explicitly named on the command line. + +The `external-sources` [[directive]] allows disabling this, but must be specified in `.shellcheckrc`. This is because the sandbox would be useless if the sandboxed script can disable it for itself. + +### Exceptions: + +None. + +### Related resources: + +* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc! \ No newline at end of file