From a8e801502727fa32c604751a2deb1736bd289a53 Mon Sep 17 00:00:00 2001 From: David Auer Date: Fri, 26 Jan 2024 19:29:57 +0100 Subject: [PATCH] Typography --- SC1090.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SC1090.md b/SC1090.md index 73c55ae..3e816ea 100644 --- a/SC1090.md +++ b/SC1090.md @@ -1,19 +1,19 @@ -## Can't follow non-constant source. Use a directive to specify location. +## Can't follow non-constant source. Use a directive to specify location -### Problematic code: +### Problematic code ```sh . "${util_path}" ``` -### Correct code: +### Correct code ```sh # shellcheck source=src/util.sh . "${util_path}" ``` -### Rationale: +### Rationale 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. @@ -21,6 +21,6 @@ Use a [[Directive]] to point shellcheck to a fixed location it can read instead. ShellCheck v0.7.2+ will strip a single expansion followed by a slash, e.g. `${var}/util.sh` or `$(dirname "${BASH_SOURCE[0]}")/util.sh`, and treat them as `./util.sh`. This allows the use of `source-path` directives or `-P` flags to specify the location. -### Exceptions: +### Exceptions If you don't care that ShellCheck is unable to account for the file, specify `# shellcheck source=/dev/null`. \ No newline at end of file