Skip to content

Checks ​

Every check the linter runs, generated from the lint catalog by go test ./internal/lint -run TestChecksDoc -update. SC codes reuse ShellCheck's numbering and DL codes Hadolint's, for Dockerfiles; see hadolint.md for how they differ from it. SL codes are shell-lsp's own and are described in rules.md. Optional checks run only when switched on by name with enable=, --enable or the lint.optional setting. The Minimal column marks the checks the minimal profile keeps; see Profiles.

CodeSeverityOptionalMinimalSummary
SC1001infoA backslash before an ordinary character outside quotes does nothing.
SC1003infoyesA backslash cannot escape a single quote inside single quotes, so the quote ends the string.
SC1007warningyesA space after = ends the assignment, so the variable is set to empty for the next command only.
SC1008erroryesThe shebang names an interpreter that is not a shell this linter recognises.
SC1010warningyesA keyword is read as a plain word because no ; or line break comes before it.
SC1011warningyesAn apostrophe inside single quotes closes the string, leaving the rest outside the quotes.
SC1012warningyesAn escape like \n or \t outside quotes is just the letter, not a control character.
SC1014warningyesBrackets around a command test the command's name as a string instead of running it.
SC1017erroryesThe file contains a literal carriage return, usually from Windows line endings.
SC1018erroryesA Unicode space is not a plain space, so the shell does not split words on it.
SC1019erroryesA unary test operator has no operand.
SC1020erroryesA ] glued to the previous word is part of that word and does not end the test.
SC1021erroryesAn escaped \) glued to the previous word does not close the group.
SC1026erroryesA nested [ does not group conditions inside [ ].
SC1027erroryesA comparison operator has no right-hand operand.
SC1034erroryesA test opens with a single [ but closes with ]].
SC1035erroryesA test bracket needs a space between it and the next word.
SC1037erroryes$ followed by several digits expands only the first digit as a positional parameter.
SC1039erroryesAn indented terminator does not end the here-document.
SC1040erroryesA terminator indented with spaces does not end a <<- here-document, which strips only tabs.
SC1064erroryesA function body is not a compound command.
SC1071erroryesA file run by an interpreter that is not a shell is not linted.
SC1075erroryeselse if starts a nested if that needs its own fi; elif was probably meant.
SC1076erroryes[ ] does not evaluate arithmetic, so an operator there is part of a word.
SC1077erroryesAn acute accent is used where a backtick was meant.
SC1078warningyesA quote that spans several lines closes right before more text, which suggests it is unbalanced.
SC1079infoyesA quote that looks like it opens a new string closes an earlier multi-line one.
SC1080erroryesA [ test continues on the next line without a backslash before the line break.
SC1081erroryesKeywords are case sensitive, so a capitalised keyword runs as a command.
SC1082erroryesA UTF-8 byte order mark at the start of the file makes the shell misread the first line.
SC1083warningyesA brace here is a literal character, not part of an expansion or a block.
SC1084erroryesThe shebang is written !# instead of #!.
SC1087erroryes$name[ expands the variable and appends a literal bracket instead of indexing the array.
SC1090warningyesA sourced file is only known at run time, so it cannot be followed.
SC1091infoA sourced file was not found, so it is not followed.
SC1094warningyesA sourced file has syntax errors, so what it defines may be missing.
SC1097erroryes== in an assignment assigns a value starting with = instead of comparing.
SC1099erroryesA # glued to a keyword makes one word, so the keyword is not recognised.
SC1100erroryesA Unicode dash is used where a hyphen-minus test operator was meant.
SC1101erroryesA backslash escapes trailing whitespace instead of the line break, so the command ends there.
SC1103erroryesA shell directive names a shell this linter does not know.
SC1104erroryesA first line that looks like a shebang is missing its #.
SC1107warningyesA directive uses a key that does not exist.
SC1108erroryesA test operator glued to its operand is part of the word, not a comparison.
SC1109erroryesAn HTML entity copied from a web page is used instead of the character itself.
SC1110warningyesA curly quote is a literal character, not shell quoting.
SC1111warningyesA curly double quote is a literal character inside double quotes or a here-document.
SC1112warningyesA curly single quote is a literal character inside single quotes.
SC1113erroryesA first line that looks like a shebang is missing its !.
SC1114erroryesWhitespace before #! keeps the shebang from working.
SC1115erroryesWhitespace between # and ! keeps the shebang from working.
SC1118erroryesA here-document terminator followed by whitespace does not end the here-document.
SC1119erroryesA here-document terminator followed by ) does not end the here-document.
SC1120erroryesA here-document terminator followed by a comment does not end the here-document.
SC1121erroryesA here-document terminator followed by an operator does not end the here-document.
SC1122erroryesA here-document terminator followed by more text does not end the here-document.
SC1123erroryesA directive stands in front of a keyword where it has no command to apply to.
SC1124erroryesA directive in front of a case branch pattern has no effect.
SC1125erroryesA disable list contains something that is not a check code or range.
SC1126erroryesA directive placed after a command's words or inside a continued list is rejected by ShellCheck.
SC1127erroryesA comment starts with // or a similar marker instead of #, so the line runs as a command.
SC1128erroryesA shebang that is not on the first line has no effect.
SC1129erroryesA ! glued to a keyword makes one word, so the keyword is not recognised.
SC1130erroryesA : glued to a keyword makes one word, so the keyword is not recognised.
SC1131erroryeselsif, elseif or a similar spelling is not a keyword; the shell only has elif.
SC1132warningyesAn unquoted & inside a word, such as in a URL, sends the command to the background.
SC1135styleClosing quotes right after $ only to keep it literal is confusing.
SC1139erroryes-a or -o joins test commands outside [ ], where it is just another word.
SC1140erroryesWords after the closing ] become arguments of the test.
SC1143erroryesA commented-out line ends a continued command, so the lines below run separately.
SC1144erroryesexternal-sources=true only takes effect in a .shellcheckrc file.
SC1145erroryesexternal-sources is set to something other than true or false.
SC1146erroryesextended-analysis is set to something other than true or false.
SC2000styleecho piped to wc counts a string's length that ${#var} gives directly.
SC2001stylesed runs on a single value that a ${var//pattern/replacement} expansion could handle.
SC2002styleuseless-use-of-catcat only feeds a file to the next command, which could read it directly.
SC2003styleexpr is an antiquated way to do arithmetic.
SC2004styleThe $ on a variable inside arithmetic is unnecessary.
SC2005styleecho only repeats the output of a command substitution.
SC2006styleBacktick command substitution is legacy syntax that nests and escapes poorly.
SC2007style$[ ] is an obsolete arithmetic form.
SC2009infoyesGrepping ps output also matches the grep itself.
SC2010warningyesFiltering ls output with grep breaks on unusual file names.
SC2011warningyesPiping ls output to xargs breaks on file names with spaces.
SC2012infoyesParsing ls output breaks on unusual file names.
SC2013infoyesA for loop over command output splits it into words, not lines.
SC2014infoyesAn expansion in a find -exec command runs once before find starts, not once per file.
SC2015infoyesA && B || C is not if-then-else: C also runs when A succeeds and B fails.
SC2016infoSingle quotes keep $ and backticks literal, so nothing in them is expanded.
SC2017infoyesInteger division truncates before a later multiplication, losing precision.
SC2018infoyesThe range a-z misses accented and other non-ASCII lowercase letters.
SC2019infoyesThe range A-Z misses accented and other non-ASCII uppercase letters.
SC2020infoyestr maps single characters, not words, so a repeated letter only uses its last mapping.
SC2021infoyesBrackets around a tr range are matched as literal characters.
SC2022infoyesIn a regex, x* repeats the character before it rather than matching anything after it.
SC2023infoyesThe time keyword only accepts -p, so other options need /usr/bin/time.
SC2024warningyessudo or doas does not apply to a redirection, which the shell opens with the caller's permissions.
SC2025infoyesTerminal escape sequences in PS1 are not wrapped in \[ \], so bash miscounts the prompt's width.
SC2026infoyesA word between single-quoted strings is not quoted.
SC2027warningyesQuotes inside a string close and reopen it, leaving the inner part unquoted.
SC2028infoecho does not reliably interpret backslash escapes.
SC2029infoyesAn expansion in an ssh command runs on the client, not on the server.
SC2030infoyesA variable changed in a subshell loses the change when the subshell exits.
SC2031infoyesA variable read here still has its value from before a change made in a subshell.
SC2032infoyesA command that runs external programs is given a function this script defines.
SC2033warningyesA command that runs external programs cannot see a shell function or alias.
SC2034warningyesA variable is assigned but never read.
SC2035infoyesA file matched by a glob may start with a dash and be read as an option.
SC2036warningyesA pipeline stage that only assigns a variable pipes nothing.
SC2037erroryesA command's output is meant to be assigned, but the value is a prefix assignment for the next word.
SC2038warningyesPiping find output to xargs breaks on file names with spaces or newlines.
SC2041warningyesA single-quoted loop item is one literal word, not a command whose output is iterated.
SC2042warningyesLoop items are separated by spaces, not commas.
SC2043warningyesA loop over a single constant item runs exactly once.
SC2044warningyesIterating over find output breaks on file names with spaces or newlines.
SC2045erroryesIterating over ls output breaks on file names with spaces or newlines.
SC2046warningyesAn unquoted command substitution is split into words and expanded as a glob.
SC2048warningyesAn unquoted $@ or ${array[@]} joins the elements and splits them again.
SC2049warningyes=~ is given a glob, but it takes a regex.
SC2050warningyesBoth sides of a comparison are constant, so the test always has the same result.
SC2051warningyesBraces are expanded before variables, so a range built from variables is not a range.
SC2053warningyesAn unquoted right-hand side of == or != in [[ ]] is matched as a glob pattern.
SC2054warningyesArray elements are separated by whitespace, so commas become part of the values.
SC2055warningyesA value always differs from at least one of two others, so a != ... -o != ... test is always true.
SC2056warningyesA value always differs from at least one of two others, so a != ... || != ... list is always true.
SC2057warningyesA comparison uses an operator that test does not understand.
SC2058warningyesA test uses an operator that does not exist.
SC2059infoyesA printf format contains an expansion, so data can be read as format directives.
SC2060warningyesAn unquoted tr set may be expanded as a glob before tr sees it.
SC2061warningyesAn unquoted find pattern may be expanded by the shell before find sees it.
SC2062warningyesAn unquoted grep pattern may be expanded as a glob before grep sees it.
SC2063warningyesgrep is given a glob, but it takes a regular expression.
SC2064warningyesAn expansion in a trap handler is expanded when the trap is set, not when it fires.
SC2065warningyes> or < inside test is a file redirection, not a comparison.
SC2066erroryesDouble quotes make a loop list a single item, so the loop runs once.
SC2067erroryesA find -exec action has no separate ; or + argument to end it.
SC2068erroryesAn unquoted array expansion splits its elements again.
SC2069warningyes2>&1 placed before a file redirection still points stderr at the old target.
SC2070erroryes-n with an unquoted operand inside [ ] is true even when the value is empty.
SC2071erroryesA string comparison operator is used to compare numbers.
SC2072erroryesShell tests compare integers only, not decimals.
SC2073erroryesAn unescaped < or > inside [ ] is a redirection, not a comparison.
SC2074erroryes=~ is used inside [ ], which has no regex matching.
SC2075erroryes< or > is escaped or quoted inside [[ ]], where it must not be.
SC2076warningyesA quoted right-hand side of =~ is matched literally instead of as a regex.
SC2077erroryesA comparison without spaces around its operator only tests that the word is non-empty.
SC2078erroryesA test of a constant string is always true.
SC2079erroryesShell arithmetic is integer only, so a decimal is not a valid number.
SC2080erroryesA leading 0 makes a number octal, where 8 and 9 are not valid digits.
SC2081erroryes[ ] compares a glob pattern as literal text and never matches it.
SC2082erroryesAn expansion nested inside a parameter name does not compute the variable to expand.
SC2083erroryesA space after ./ runs the current directory instead of the intended file.
SC2084erroryesThe result of an arithmetic expansion is run as a command.
SC2086infoyesAn unquoted expansion is split on whitespace and expanded as a glob.
SC2087warningyesA here-document sent to ssh is expanded locally before it is sent.
SC2088warningyesA quoted ~ is not expanded to the home directory.
SC2089warningyesQuotes or backslashes stored in a value do not group words when it is expanded.
SC2090warningyesQuotes or backslashes stored in a variable are passed on literally when it is expanded.
SC2091warningyesThe output of a $( ) command substitution is run as a command.
SC2092warningyesThe output of a backtick command substitution is run as a command.
SC2093warningyesexec replaces the shell, so the commands after it only run if exec fails.
SC2094infoyesA pipeline reads and writes the same file, which the output redirection truncates first.
SC2095warningyesA command inside a while read loop reads stdin and may consume the loop's input.
SC2096erroryesThe kernel passes everything after the shebang interpreter as a single argument.
SC2097warningyesA prefix assignment only affects the command's environment, not expansions on the same line.
SC2098warningyesAn expansion runs before a prefix assignment on the same line takes effect.
SC2099warningyesArithmetic written as separate words in an assignment is not evaluated.
SC2100warningyesAn arithmetic-looking value is assigned as a literal string.
SC2101warningyesA character class like [:digit:] is not inside a second pair of brackets.
SC2102infoyesA bracket expression lists the same character twice, which suggests it was meant to match numbers.
SC2103infoChanging back with cd after commands can leave the script in the wrong directory if a cd fails.
SC2104erroryesbreak or continue in a function does not leave the function.
SC2105erroryesbreak or continue is used outside a loop.
SC2106warningyesbreak or continue in a subshell only exits the subshell, not the surrounding loop.
SC2107erroryes&& is used inside [ ], where it cannot combine tests.
SC2108erroryes-a does not combine tests inside [[ ]].
SC2109erroryes|| is used inside [ ], where it cannot combine tests.
SC2110erroryes-o does not combine tests inside [[ ]].
SC2111erroryesksh does not accept both the function keyword and () in one definition.
SC2112warningyesThe function keyword is not POSIX.
SC2113warningyesThe function keyword is not POSIX.
SC2114warningyesA command removes a path recursively.
SC2115warningyesA removal path built from expansions removes a top-level path if they are empty.
SC2116styleecho only passes its arguments through to a command substitution.
SC2117infoyessu starts an interactive shell, so the rest of the script waits until it exits.
SC2118erroryesksh reads |& as starting a coprocess, not as a pipe of stdout and stderr.
SC2119infoyesA function reads positional parameters, but this call passes none.
SC2120warningyesA function reads positional parameters, but no call passes any arguments.
SC2121warningyesset does not assign variables.
SC2122erroryes<= and >= are not test operators.
SC2123warningyesPATH is replaced with something that is not a list of directories.
SC2124warningyesAssigning an array to a string joins its elements.
SC2125warningyesGlobs and brace expansions are not expanded in assignments.
SC2126stylegrep piped to wc -l counts matching lines that grep -c counts directly.
SC2127erroryesA construct is used that only bash or ksh supports.
SC2128warningyesExpanding an array without an index gives only its first element.
SC2129styleSeveral commands in a row append to the same file, opening it each time.
SC2139warningyesAn expansion in an alias body is expanded when the alias is defined, not when it is used.
SC2140warningyesQuotes inside a double-quoted word end one string and start another.
SC2141warningyesAn escape like \n inside a quoted IFS value is a literal backslash and letter, not a control character.
SC2142erroryesAliases cannot take positional parameters.
SC2143styleA test checks whether grep's output is empty instead of using its exit status.
SC2144erroryesA file test operator is given a glob, which it does not expand into a list.
SC2145erroryesJoining text with an array attaches the text only to its first and last elements.
SC2146warningyesA find action only applies to the last -o branch.
SC2147warningyesA quoted ~ in PATH is not expanded.
SC2148erroryesNothing names the shell the script targets.
SC2150warningyesfind -exec runs a program directly, not a shell command line.
SC2151erroryesreturn or exit is given more than one status.
SC2152erroryesreturn or exit is given a status that is not an integer from 0 to 255.
SC2153infoyesA variable is never assigned, but one with a similar name is.
SC2154warningyesA variable is read but never assigned in this script.
SC2155warningyesDeclaring and assigning in one command masks the status of the command substitution.
SC2156warningyesfind's {} is injected into the text of an inline script.
SC2157erroryesA test operand always contains literal text, so the test always has the same result.
SC2158erroryes[ false ] only tests that the string false is non-empty, so it is always true.
SC2159erroryes[ 0 ] only tests that the string 0 is non-empty, so it is always true.
SC2160style[ true ] does the same as running true.
SC2161style[ 1 ] is always true.
SC2162infoyesread without -r treats backslashes as escapes and drops them.
SC2163warningyesexport of $name exports the variable named by its value, not the variable itself.
SC2164warningyesThe commands after a failed cd run in the wrong directory.
SC2165warningyesA nested loop reuses the outer loop's variable.
SC2166warningyes-a or -o inside [ ] is ambiguous and obsolescent.
SC2167warningyesA nested loop overwrites the outer loop's variable.
SC2168erroryeslocal is used outside a function.
SC2170erroryesA numeric comparison operator is given an operand that is not a number.
SC2171warningyesA closing bracket ends a test that was never opened.
SC2172warningyesSignal numbers differ between systems.
SC2173erroryesSIGKILL and SIGSTOP cannot be trapped.
SC2174warningyesmkdir -p with -m only sets the mode of the deepest directory.
SC2175styleA brace range given to eval unquoted is expanded before the variable is substituted.
SC2176warningyestime on a pipeline is undefined in POSIX sh.
SC2177warningyestime on a compound command is undefined in POSIX sh.
SC2178warningyesAssigning a plain string to an array only replaces its first element.
SC2179warningyesAppending a string to an array changes its first element instead of adding one.
SC2180warningyesBash arrays have one dimension, so a second subscript does not index into an element.
SC2181style$? is inspected after a command instead of testing the command directly.
SC2182erroryesA printf format has no conversion specifiers, so its arguments are ignored.
SC2183warningyesA printf format expects a different number of arguments than it is given.
SC2184warningyesAn unquoted argument to unset may have its index brackets expanded as a glob.
SC2185infofind has no explicit starting path, which some versions require.
SC2186warningyestempfile is deprecated and missing from many systems.
SC2187warningyesash has no specification of its own, so the script is checked as dash.
SC2188warningyesA redirection stands alone without a command.
SC2189erroryesA pipeline element is only a redirection, with no command to feed.
SC2190warningyesAn element of an associative array has no key.
SC2191warningyesAn = in an array element is literal text rather than part of [index]=value.
SC2192warningyesAn array element has an index but no value.
SC2193warningyesNo string can match both sides of a comparison, so it never succeeds.
SC2194warningyesThe case word is a constant, so the same branch is taken every time.
SC2195warningyesA case pattern can never match the case word.
SC2196infoegrep is deprecated and missing from some systems.
SC2197infofgrep is deprecated and missing from some systems.
SC2198warningyes[ ] receives each element of an array as a separate word, which breaks the test.
SC2199erroryes[[ ]] joins an array expansion into one string.
SC2200warningyesBrace expansion turns a [ ] operand into several words.
SC2201erroryesBrace expansion does not happen inside [[ ]].
SC2202warningyesA glob in a [ ] operand can expand to several words.
SC2203erroryes[[ ]] does not expand a glob outside the right side of = and !=.
SC2204erroryes( ) runs a subshell, not a test.
SC2205warningyes( ) runs a subshell, not a comparison.
SC2206warningyesAn unquoted expansion is split into words and globbed when building an array.
SC2207warningyesCommand output is split on whitespace and globbed when building an array.
SC2208erroryesThe variable name given to -v is expanded as a glob.
SC2209warningyesA command name is assigned as a string instead of its output.
SC2210warningyesA redirection to a number writes to or reads from a file with that name.
SC2211warningyesA glob is used as a command name.
SC2212styleAn empty test is always false.
SC2213warningyesgetopts accepts an option that the case statement has no branch for.
SC2214warningyesA case branch handles an option that is not in the getopts string.
SC2215warningyesA word that looks like an option is used as a command name.
SC2216warningyesA command that does not read standard input is piped data.
SC2217warningyesA command that does not read standard input is given redirected input.
SC2218erroryesA function is called before the line that defines it runs.
SC2219stylelet is used where an arithmetic command needs no quoting.
SC2220warningyesA case statement handling getopts options has no *) branch for invalid options.
SC2221warningyesA case pattern also matches everything a later pattern matches, so that one is never reached.
SC2222warningyesA case pattern never matches because an earlier pattern catches everything it would.
SC2223infoyesAn unquoted ${var:=default} is globbed on every run.
SC2224erroryesmv is given only one path and no destination.
SC2225erroryescp is given only one path and no destination.
SC2226warningyesln is given only one path and no link name.
SC2227warningyesA redirection on find applies to find itself, not to the command run by -exec.
SC2229warningyesread $name reads into the variable named by the value, not the variable itself.
SC2230infodeprecate-whichwhich is not standard and behaves differently between systems.
SC2231infoyesAn unquoted expansion next to a glob is split and globbed along with it.
SC2232warningyessudo or doas is given a shell builtin, which has no program to run.
SC2233styleParentheses around a condition start a needless subshell.
SC2234styleParentheses around a test start a needless subshell.
SC2235styleTests are grouped with ( ), which starts a needless subshell.
SC2236styleavoid-negated-conditionsA negated test operator is written as ! op instead of its opposite.
SC2237styleavoid-negated-conditionsA negated [ ] or [[ ]] test is written as ! instead of using the opposite operator.
SC2238warningyesA redirection names a file that is also a command, which suggests a pipe was meant.
SC2239erroryesThe shebang interpreter is not an absolute path.
SC2240warningyesArguments after the file given to . are not passed to it in sh.
SC2241erroryesexit is given more than one status.
SC2242erroryesexit is given a status that is not an integer from 0 to 255.
SC2243styleavoid-nullary-conditionsA test of a command substitution relies on the implicit non-empty check.
SC2244styleavoid-nullary-conditionsA test of a string relies on the implicit non-empty check instead of -n.
SC2245warningyesksh applies a file test operator only to the first match of a glob.
SC2246erroryesThe shebang interpreter ends in a slash, so it names a directory.
SC2247warningyes$" starts a translated string where a quoted substitution was meant.
SC2248stylequote-safe-variablesA variable that holds no spaces or globs today is expanded unquoted.
SC2249infoadd-default-caseA case statement has no *) branch for unexpected values.
SC2250stylerequire-variable-bracesA variable is expanded without braces.
SC2251infoyesA negated command never triggers set -e.
SC2252warningyesA value always differs from at least one of several constants, so a || chain of != tests is always true.
SC2253warningyeschmod -r removes read permission instead of changing modes recursively.
SC2254warningyesAn unquoted expansion in a case pattern is matched as a glob.
SC2255erroryesA numeric operand in [ ] is an unquoted glob, not a number.
SC2256warningyes$"name" is a translated string, not an expansion of the variable.
SC2257warningyesArithmetic that modifies a variable in a redirection may run in a subshell or not at all.
SC2258warningyesA trailing comma becomes part of a loop item.
SC2259erroryesAn input redirection replaces the piped input, discarding the previous command's output.
SC2260erroryesAn output redirection takes the output away from the pipe, so the next command reads nothing.
SC2261erroryesSeveral redirections compete for the same file descriptor, and only the last takes effect.
SC2262warningyesAn alias is used in the same parsing unit that defines it, where it does not take effect yet.
SC2263infoyesA command runs as a program instead of the alias defined in the same parsing unit.
SC2264erroryesA function that wraps a command calls itself unconditionally and recurses forever.
SC2265erroryesA single & between tests runs the first in the background instead of combining them.
SC2266warningyesA single | between tests pipes between them instead of combining them.
SC2267infoxargs -i is deprecated.
SC2268styleThe x prefix in comparisons is an obsolete workaround.
SC2269infoA variable is assigned its own value, which does nothing.
SC2270erroryesPositional parameters cannot be assigned with =.
SC2271erroryesA variable name computed from an expansion cannot be assigned with =.
SC2272erroryesA command name contains ==, which suggests a comparison or assignment was meant.
SC2273erroryesA line of equals signs looks like a leftover merge conflict marker or text border.
SC2274erroryesA command cannot start with ===.
SC2275erroryesA command cannot start with =.
SC2276erroryesA word with = is run as a command because the part before = is not a valid variable name.
SC2277erroryes$0 cannot be assigned like a variable in bash.
SC2278erroryes$0 cannot be assigned in ksh.
SC2279erroryes$0 cannot be assigned in this shell.
SC2280erroryes$0 cannot be assigned in sh.
SC2281erroryesThe left side of an assignment has a $.
SC2282erroryesVariable names cannot start with a digit, so the assignment runs as a command.
SC2283erroryesSpaces around = turn an assignment into a command.
SC2284erroryes== on its own is neither an assignment nor a command.
SC2285erroryesSpaces around += turn an append into a command.
SC2286erroryesThe command name is an empty string.
SC2287erroryesA command name ends in a slash, so it names a directory.
SC2288warningyesA command name ends in a character that suggests a stray character or a missing space.
SC2289erroryesA command name contains a tab or a line break.
SC2290erroryesA space before = or += in a declaration turns the assignment into a separate word.
SC2291infoyesUnquoted runs of spaces between echo arguments collapse to a single space.
SC2292stylerequire-double-brackets[ ] is used for a test where [[ ]] is available.
SC2293styleeval is given ${array[@]@Q}, although it joins its arguments with spaces anyway.
SC2294warningyeseval joins array elements into one string and re-splits it, losing their boundaries.
SC2295infoyesAn unquoted expansion inside a pattern is matched as a glob.
SC2296erroryesA parameter expansion starts with a character no parameter name can start with.
SC2297erroryesDouble quotes are used inside ${ }.
SC2298erroryesAn expansion is used as the name in ${ }.
SC2299erroryesParameter expansions cannot be nested.
SC2300erroryesParameter expansion cannot operate on a command substitution.
SC2301erroryesA parameter expansion starts with quotes or other unexpected syntax.
SC2302warningyesA loop iterates over an associative array's values but uses the loop variable as a key.
SC2303warningyesA value taken from an associative array is used as a key.
SC2304erroryesAn unescaped * given to expr is expanded as a glob.
SC2305warningyesAn unquoted expr regex may be expanded as a glob.
SC2306warningyesUnescaped glob characters in expr arguments may be expanded by the shell.
SC2307warningyesexpr is given too few arguments to form an expression.
SC2308infoAn expr keyword is not specified by POSIX.
SC2309warningyesA numeric operator inside [[ ]] evaluates its operand as arithmetic.
SC2310infocheck-set-e-suppressedset -e has no effect inside a function invoked as a condition.
SC2311infocheck-set-e-suppressedset -e has no effect inside a command substitution that does not inherit it.
SC2312infocheck-extra-masked-returnsA command's exit status is masked by its context.
SC2313warningyesAn unquoted array index in a read target may be expanded as a glob.
SC2314erroryesBats ignores the status of a negated command, so the line cannot fail the test.
SC2315erroryesBats ignores the status of a negated test, so the line cannot fail the test.
SC2316erroryesA word given to a declaration command is parsed as a variable name, not as a modifier.
SC2317infoA command can never run, because every path to it exits, returns or loops forever first.
SC2318warningyesA variable assigned in a declaration is read again in the same declaration before it takes effect.
SC2319warningyes$? after a test is the status of that test, not of the command it checked.
SC2320warningyes$? after echo is the status of echo, not of the command before it.
SC2321style$(( )) around an array index is redundant, since indices are already arithmetic.
SC2322styleDoubled parentheses in arithmetic are redundant.
SC2323styleParentheses around a whole arithmetic expression are redundant.
SC2324warningyes+= on a plain variable appends text instead of adding a number.
SC2325erroryessh allows only one ! before a pipeline.
SC2326erroryes! cannot negate a single stage after a |.
SC2327warningyesA command substitution is always empty because the command's output is redirected elsewhere.
SC2328erroryesA redirection takes the output away from the command substitution it is in.
SC2329infoA function is never invoked, and the script always exits before it could be sourced and called.
SC2330erroryesbusybox sh expands a glob on the right of == or != in [[ ]] against file names before comparing.
SC2331style-a as a file test is a legacy synonym of -e that is easily confused with the -a conjunction.
SC2332erroryes[ ! -o name ] or [ ! -a file ] reads -o or -a as a binary operator and is always true.
SC2333warningyesA value cannot equal two different constants at once, so the condition is always false.
SC2334warningyesA value cannot equal two different numbers at once, so the && is always false.
SC2335styleavoid-negated-conditionsA negated comparison is written as ! a op b instead of using the inverted operator.
SC2336warningyescp -r is implementation-defined for special files.
SC2337warningyesA command that may exit before reading all its input can make the writer upstream fail with SIGPIPE under pipefail.
SC2338stylerequire-double-equals= is used for string comparison in a bash test where == is preferred.
SC3001warningyesProcess substitution is undefined in POSIX sh and dash.
SC3002warningyesExtended globs are undefined in POSIX sh.
SC3003warningyesANSI-C quoted $'...' strings are undefined in POSIX sh and dash before 0.5.13.
SC3004warningyesLocale-translated $"..." strings are undefined in POSIX sh.
SC3005warningyesC-style for ((...)) loops are undefined in POSIX sh.
SC3006warningyesThe arithmetic command ((...)) is undefined in POSIX sh.
SC3007warningyes$[...] arithmetic is undefined in POSIX sh.
SC3008warningyesselect loops are undefined in POSIX sh.
SC3009warningyesBrace expansion is undefined in POSIX sh.
SC3010warningyes[[ ]] tests are undefined in POSIX sh and dash.
SC3011warningyesHere-strings with <<< are undefined in POSIX sh.
SC3012warningyesLexicographic comparison with < or > in [ ] is undefined in POSIX sh.
SC3014warningyes== in [ ] is undefined in POSIX sh and dash.
SC3015warningyesRegex matching with =~ is undefined in POSIX sh and dash.
SC3016warningyestest -v is undefined in POSIX sh.
SC3017warningyesThe unary test -a is undefined in POSIX sh.
SC3018warningyesThe ++ and -- operators are undefined in POSIX sh and dash.
SC3019warningyesExponentiation with ** is undefined in POSIX sh and dash.
SC3020warningyesRedirecting both streams with &> is undefined in POSIX sh and dash.
SC3021warningyesRedirecting both streams to a file with >& is undefined in POSIX sh and dash.
SC3022warningyesNamed file descriptors like {fd}> are undefined in POSIX sh.
SC3023warningyesFile descriptor numbers above 9 are undefined in POSIX sh and dash.
SC3024warningyesAppending with += is undefined in POSIX sh.
SC3025warningyesNetwork pseudo-devices such as /dev/tcp are undefined in POSIX sh.
SC3026warningyesNegating a bracket expression with ^ is undefined in POSIX sh and dash before 0.5.13.
SC3028warningyesA bash-specific variable is undefined in POSIX sh.
SC3029warningyesThe |& operator is undefined in POSIX sh.
SC3030warningyesArrays are undefined in POSIX sh.
SC3031warningyesRedirecting to or from a glob is undefined in POSIX sh.
SC3032warningyescoproc is undefined in POSIX sh.
SC3033warningyesA function name that is not a valid identifier is undefined in POSIX sh and dash.
SC3034warningyesReading a file with $(< file) is undefined in POSIX sh.
SC3035warningyesReading a file with `< file` is undefined in POSIX sh.
SC3036erroryesecho in dash and busybox sh does not support this flag.
SC3037warningyesecho flags are undefined in POSIX sh.
SC3038warningyesexec options are undefined in POSIX sh.
SC3039warningyeslet is undefined in POSIX sh and dash.
SC3040warningyesThis set -o option is undefined in POSIX sh.
SC3041warningyesThis set flag is undefined in POSIX sh.
SC3042warningyesThis set option is undefined in POSIX sh.
SC3043warningyeslocal is undefined in POSIX sh.
SC3044warningyesA bash builtin is used that is undefined in POSIX sh.
SC3045warningyesA builtin option is used that is undefined in POSIX sh.
SC3046warningyessource is undefined in POSIX sh and dash.
SC3047warningyesTrapping this signal or condition is undefined in POSIX sh.
SC3048warningyesThe SIG prefix on a signal name is undefined in POSIX sh and dash.
SC3049warningyesLowercase signal names are undefined in POSIX sh.
SC3050warningyesprintf %q is undefined in POSIX sh.
SC3051warningyessource is undefined in POSIX sh and dash, also when the file it loads is followed.
SC3052warningyesArithmetic base prefixes like 16# are undefined in POSIX sh and dash.
SC3053warningyesIndirect expansion with ${!name} is undefined in POSIX sh.
SC3054warningyesArray subscripts are undefined in POSIX sh.
SC3055warningyesListing array keys with ${!array[@]} is undefined in POSIX sh.
SC3056warningyesListing variable names by prefix with ${!prefix*} is undefined in POSIX sh.
SC3057warningyesSubstring expansion ${var:offset} is undefined in POSIX sh and dash.
SC3058warningyesApplying a length or trim operator to $@ or $* is undefined in POSIX sh.
SC3059warningyesCase modification in parameter expansion is undefined in POSIX sh.
SC3060warningyesPattern substitution ${var/pattern/replacement} is undefined in POSIX sh and dash.
SC3061warningyesread without a variable name is undefined in POSIX sh and dash.
SC3062warningyesChecking a shell option with test -o is undefined in POSIX sh.
SC3063warningyestest -R is undefined in POSIX sh.
SC3064warningyestest -N is undefined in POSIX sh.
SC3065warningyestest -k is undefined in POSIX sh.
SC3066warningyestest -G is undefined in POSIX sh.
SC3067warningyestest -O is undefined in POSIX sh.
SL1001warningyeseval runs untrusted data as code.
SL1002warningyesA shell -c script is built from untrusted data.
SL1003warningarithmetic-injectionyesUntrusted data is evaluated as arithmetic.
SL1004warningyesA sourced path is built from untrusted data.
SL1005warningyesDownloaded code runs unchecked.
SL1006warningyesA sensitive path is made writable by every user.
SL2001styleA function in a script is never called.
SL2002warningyesAn `@` transformation the shell does not know.
SL2003erroryesA declaration assigns a name that is not a variable name.
SL2004warningyesA trap is set inside a subshell.
SL2005warningyesexit only leaves a subshell and nobody checks its status.
SL2006infoyesA temporary file or directory is never removed.
SL2007infoyesA function runs pushd but never popd.
SL2008erroryesA `${…}` the shell rejects when it runs it.
SL2009infounused-directivesA disabled check that nothing here reports.
SL2010warningyesA NUL byte cuts a `$'...'` string short.
SL2011warningyesTwo bounds on the same value leave no number in between.
SL2012stylerequire-test-grouping`&&` and `||` are mixed in `[[ ]]` without parentheses.
SL2013warningcheck-relative-sourcesyesA sourced file is found relative to where the script is run from.
SL2014stylerequire-local-variablesA function assigns a variable it did not declare local.
SL2015styleavoid-global-reassignmentA global variable is given a new value.
SL2016warningyesA pattern uses a glob operator whose shell option is never turned on.
SL2017warningyesA capture variable is read, but nothing in the file sets it.
SL2018warningyesAn unquoted & in a bash replacement inserts the matched text.
SL2019erroryeszsh rejects a pattern as bad.
SL2020styleAn external command does what a parameter expansion or [[ ]] does without a new process.
SL2021styleuseless-use-of-cat$(cat file) runs cat to read a file the shell can read itself.
SL2022warningyesA regular expression escape does not work where =~ uses it.
SL2023warningyesA [key]=value element in an associative array's key value list.
SL2024warningyesAn associative array's key value list has an odd number of elements.
SL3001erroryesAn awk program does not parse.
SL3002erroryesA sed script does not parse.
SL3003erroryesA jq filter does not parse.
SL4001stylegoogle-shebangAn executable does not start with `#!/bin/bash`.
SL4002stylegoogle-file-headerA file does not open with a comment about its contents.
SL4003stylegoogle-todoA TODO comment does not name an owner.
SL4004stylegoogle-function-commentsA function that is not short has no header comment.
SL4005stylegoogle-comment-sectionsA function header comment leaves out a section the function needs.
SL4006stylegoogle-script-lengthA script is longer than 100 lines.
SL4007stylegoogle-mainA script with functions does not end with `main "$@"`.
SL5001erroryesThe justfile does not parse.
SL5002erroryesA dependency or alias names a recipe that does not exist.
SL5003erroryesAn expression uses a variable or parameter that is not defined.
SL5004erroryesA function that does not exist is called.
SL5005erroryesA function is called with the wrong number of arguments.
SL5006erroryesA dependency passes the wrong number of arguments.
SL5007erroryesA setting that just does not know is set.
SL5008erroryesAn attribute that just does not know is used.
SL5009erroryesTwo recipes have the same name.
SL5010erroryesA variable is assigned twice.
SL5011erroryesAn alias clashes with another alias or a recipe of the same name.
SL5012erroryesRecipes or variables depend on themselves.
SL5013infoA recipe parameter is never used.
SL5014infoA variable is never used.
SL5015erroryesA setting is set twice.
SL5016erroryesA setting has a value just refuses.
SL5017erroryesA path names a module that does not exist.
SL5018erroryesAn imported file or module source file is not found.
SL5019erroryesA recipe's parameters are in an order just refuses.
SL5020erroryesAn attribute is used in a way just refuses.
SL5021erroryesA recipe line is indented differently from the recipe's first line.
SL5022warningyesA deprecated function or setting is used.
SL5023erroryesA feature is used without the setting it needs.
SL5024warningyesA recipe depends on an absent module.
SL5025erroryesTwo user-defined functions have the same name.
SL5026erroryesA compile-time value runs a backtick or calls a function.
SL6001erroryesThe Makefile does not parse.
SL6002erroryesA conditional is not balanced.
SL6003erroryesA `define` has no `endef`, or an `endef` has no `define`.
SL6004erroryesA recipe line starts with spaces instead of a tab.
SL6005erroryesA recipe line comes before any rule.
SL6006infoA variable is used but never set.
SL6007erroryesA recursively expanded variable refers to itself.
SL6008warningyesA `.PHONY` target has no rule.
SL6009warningyesA target gets a second recipe.
SL6010warningyesA function make does not know is called.
SL6011erroryesA built-in function gets the wrong number of arguments.
SL6012erroryesA variable reference is not closed.
SL6013erroryesAn included Makefile is not found.
SL6014infoA variable is set but never used.
SL6015warningyesA deferred variable reference is not closed.
SL6016warningyesA target does not match its static pattern.
SL6017warningyesA standard target is missing from `.PHONY`.
SL7001erroryesThe Dockerfile does not parse.
SL7002erroryesAn instruction is not one BuildKit knows.
SL7003erroryesA flag is not one the instruction takes.
SL7004warningyes`CMD` or `ENTRYPOINT` uses the shell form.
SL7005info`COPY --from` names a stage that does not exist.
SL7006warningyesA variable is used but never declared.
SL7007warningyesTwo stages have the same name.
SL7008infoA build argument is declared but never used.
SL7009warningyesA stage name is not lowercase.
SL7010warningyes`AS` does not match the casing of `FROM`.
SL7011warningyesAn empty line continues an instruction.
SL7012warningyesAn instruction is not cased like the others.
SL7013warningyesA stage uses a reserved name.
SL7014warningyes`MAINTAINER` is deprecated.
SL7015warningyes`WORKDIR` is relative before the stage sets one.
SL7016warningyesA stage has more than one `CMD`, `ENTRYPOINT` or `HEALTHCHECK`.
SL7017warningyes`ENV` or `LABEL` uses the legacy `key value` form.
SL7018warningyesA secret is passed in `ARG` or `ENV`.
SL7019warningyes`EXPOSE` gives the protocol in uppercase.
SL7020warningyes`EXPOSE` maps a host port.
SL7021warningyesThe default of a build argument leaves a `FROM` image empty.
SL7022warningyes`FROM --platform` is a constant.
SL7023warningyes`FROM --platform=$TARGETPLATFORM` is redundant.
SL7024erroryes`COPY --from` names a stage that is not built before it.
SL8001erroryesThe Nix file does not parse.
SL8002erroryesA variable has no binding.
SL8003erroryesAn attribute is defined twice.
SL8004erroryesA function pattern names an argument twice.
SL8005infoA `let` binding is never read.
SL8006infoA function never reads its argument or its `@` name.
SL8007infoA function pattern names an argument it never reads.
SL8008infoParentheses change nothing.
SL8009infoAn `if` picks between `true` and `false`.
SL8010info`rec` has nothing to do.
SL8011info`x = x;` in a set that is not recursive is `inherit x;`.
SL8012warningyes`or` is used as a variable.
SL8013infoA `let` binds nothing.
SL8014infounescaped-antiquotationsAn antiquotation reaches a command's arguments unescaped.
SL8015infoTwo Boolean literals are compared.
SL8016info`a = b.a;` is `inherit (b) a;`.
SL8017warningyes`let { ... }` is an undocumented form.
SL8018infoA `let` is the whole body of another.
SL8019infoeta-reductionA function only passes its argument on.
SL8020infoempty-patternA pattern names nothing.
SL8021info`x@{ ... }` captures nothing that `x` does not.
SL8022infoA URI is not quoted.
SL8023warningyes`builtins.toPath` is deprecated.
SL8024info`!(a == b)` is `a != b`.
SL8025info`if x ? a then x.a else y` is `x.a or y`.
SL8026inforepeated-keysThree or more bindings in a set start with the same key.
SL8027infoA list is joined with an empty list.
SL8028infoAn `inherit` names no attribute.
SL8029infoA `let` binding or a pattern name starting with `_` is never read.
SL8030infoused-underscore-bindingsA name starting with `_` is read.
SL8031warningyesA flake reads something a pure evaluation does not have.
SL8032warningyesA fetcher has nothing that pins what it fetches.
SL8033warningyes`//` overrides an attribute that a `rec` set reads itself.
SL8034warningyesA NixOS module chooses its own shape from `config`.
SL8035infotop-level-withA `with` wraps a whole file.
SL8036infostore-copied-pathsA path is interpolated.
SL8037infopkgs-lib`pkgs.lib` is written where `lib` is in scope.
SL8038infoA flake declares an input nothing reads.
SL8039warningyesA flake overrides an input that its input does not have.
SL8040infomissing-nixpkgs-followsA flake input locks its own nixpkgs.
DL1001infono-ignore-pragmasA `# hadolint ignore=` comment hides findings; the project asks for none.
DL3001infoRUN starts a tool meant for a running system, such as an editor or process viewer, which is no use while building.
DL3002warningyesThe last USER of a stage is root, so the container runs with full privileges.
DL3003warningyesRUN changes directory with cd; WORKDIR sets the directory for every later instruction and is easier to follow.
DL3004erroryesRUN calls sudo, which builds already run as root do not need and which images rarely have configured.
DL3006warningyesFROM names an image without a tag or digest, so each build may start from a different image.
DL3007warningyesFROM uses the latest tag, which moves, so each build may start from a different image.
DL3008warningyesapt-get install lists a package without a version, so a rebuild may install a different one.
DL3009infoThe package lists apt-get update downloads are left in the image.
DL3010infoAn archive is copied in and then unpacked; ADD unpacks a local archive itself, in one layer.
DL3011erroryesEXPOSE names a port above 65535, which no protocol can use.
DL3013warningyespip install lists a package without a version, so a rebuild may install a different one.
DL3014warningyesapt-get would stop to ask for confirmation, which fails a build; it needs -y.
DL3015infoapt-get install also installs recommended packages unless --no-install-recommends is given.
DL3016warningyesnpm install lists a package without a version, so a rebuild may install a different one.
DL3018warningyesapk add lists a package without a version, so a rebuild may install a different one.
DL3019infoapk add keeps its package index in the image unless --no-cache is given.
DL3020erroryesADD copies plain files or folders; COPY does that without ADD's URL and archive handling.
DL3021erroryesCOPY with several sources needs a destination that ends in /.
DL3026erroryesFROM pulls an image from a registry that is not on the configured list of trusted registries.
DL3027warningyesRUN uses apt, whose interface is meant for people and may change; apt-get and apt-cache are stable.
DL3028warningyesgem install lists a gem without a version, so a rebuild may install a different one.
DL3030warningyesyum would stop to ask for confirmation, which fails a build; it needs -y.
DL3032warningyesThe packages and metadata yum downloads are left in the image without yum clean all.
DL3033warningyesyum install lists a package without a version, so a rebuild may install a different one.
DL3034warningyeszypper would stop to ask for confirmation, which fails a build; it needs --non-interactive.
DL3035warningyeszypper dist-upgrade upgrades the whole base image; a newer base image does that reproducibly.
DL3036warningyesThe packages and metadata zypper downloads are left in the image without zypper clean.
DL3037warningyeszypper install lists a package without a version, so a rebuild may install a different one.
DL3038warningyesdnf would stop to ask for confirmation, which fails a build; it needs -y.
DL3040warningyesThe packages and metadata dnf downloads are left in the image without dnf clean all.
DL3041warningyesdnf install lists a package without a version, so a rebuild may install a different one.
DL3042warningyespip install keeps the packages it downloads in a cache inside the image unless --no-cache-dir is given.
DL3044erroryesENV reads a variable that the same ENV sets, which Docker expands to its earlier value.
DL3045warningyesCOPY copies to a relative path while no WORKDIR is set, so the base image decides where it lands.
DL3046warningyesuseradd with a large UID and without -l writes a huge sparse lastlog file into the image.
DL3047infowget prints a progress bar line by line into the build log unless told to be quieter.
DL3048styleA label key breaks Docker's naming guidelines for label keys.
DL3049infoThe image lacks a label the configured label schema requires.
DL3050infoA label is not in the configured label schema, which is strict.
DL3051warningyesA label the label schema names is empty.
DL3052warningyesA label the label schema types as url is not an absolute URL.
DL3053warningyesA label the label schema types as rfc3339 is not an RFC 3339 date and time.
DL3054warningyesA label the label schema types as spdx is not an SPDX license expression.
DL3055warningyesA label the label schema types as hash is not a git commit hash.
DL3056warningyesA label the label schema types as semver is not a semantic version.
DL3057inforequire-healthcheckA stage has no HEALTHCHECK, so Docker cannot tell whether its container works.
DL3058warningyesA label the label schema types as email is not an email address.
DL3059infoConsecutive RUN instructions each add a layer; joining them with && makes one.
DL3060infoThe yarn cache is left in the image without yarn cache clean.
DL3062warningyesgo install names a module without a version, so a rebuild may build a different one.
DL4001warningyesA stage downloads with both wget and curl; one tool is enough.
DL4005warningyesRUN replaces /bin/sh with a link; SHELL changes the shell of later instructions without touching the image.
DL4006warningyesA pipeline in RUN succeeds when its last command does, hiding a failure earlier in the pipe, unless pipefail is set.