All Versions
25
Latest Version
Avg Release Cycle
127 days
Latest Release
901 days ago
Changelog History
Page 1
Changelog History
Page 1
-
v0.8.0 Changes
November 06, 2021โ Added
- โ
disable=all
now conveniently disables all warnings external-sources=true
directive can be added to .shellcheckrc to make shellcheck behave as if-x
was specified.- Optional
check-extra-masked-returns
for pointing out commands with suppressed exit codes (SC2312). - Optional
require-double-brackets
for recommending [[ ]] (SC2292). - SC2286-SC2288: Warn when command name ends in a symbol like
/.)'"
- SC2289: Warn when command name contains tabs or linefeeds
- SC2291: Warn about repeated unquoted spaces between words in echo
- SC2292: Suggest [[ over [ in Bash/Ksh scripts (optional)
- SC2293/SC2294: Warn when calling
eval
with arrays - SC2295: Warn about "${x#$y}" treating $y as a pattern when not quoted
- โ SC2296-SC2301: Improved warnings for bad parameter expansions
- SC2302/SC2303: Warn about loops over array values when using them as keys
- SC2304-SC2306: Warn about unquoted globs in expr arguments
- SC2307: Warn about insufficient number of arguments to expr
- SC2308: Suggest other approaches for non-standard expr extensions
- SC2313: Warn about
read
with unquoted, array indexed variable
๐ Fixed
- SC2102 about repetitions in ranges no longer triggers on [[ -v arr[xx] ]]
- SC2155 now recognizes
typeset
and local read-onlydeclare
statements - SC2181 now tries to avoid triggering for error handling functions
- SC2290: Warn about misused = in declare & co, which were not caught by SC2270+
- The flag --color=auto no longer outputs color when TERM is "dumb" or unset
๐ Changed
- SC2048: Warning about $* now also applies to ${array[*]}
- โ
SC2181 now only triggers on single condition tests like
[ $? = 0 ]
. - โ Quote warnings are now emitted for declaration utilities in sh
- โ Leading
_
can now be used to suppress warnings about unused variables - โ TTY output now includes warning level in text as well as color
โ Removed
- SC1004: Literal backslash+linefeed in '' was found to be usually correct
- โ
-
v0.7.2 Changes
April 19, 2021โ Added
disable
directives can now be a range, e.g.disable=SC3000-SC4000
- SC1143: Warn about line continuations in comments
- SC2259/SC2260: Warn when redirections override pipes
- SC2261: Warn about multiple competing redirections
- ๐ SC2262/SC2263: Warn about aliases declared and used in the same parsing unit
- SC2264: Warn about wrapper functions that blatantly recurse
- โ SC2265/SC2266: Warn when using & or | with test statements
- SC2267: Warn when using xargs -i instead of -I
- SC2268: Warn about unnecessary x-comparisons like
[ x$var = xval ]
๐ Fixed
- ๐ SC1072/SC1073 now respond to disable annotations, though ignoring parse errors is still purely cosmetic and does not allow ShellCheck to continue.
- ๐ Improved error reporting for trailing tokens after ]/]] and compound commands
#!/usr/bin/env -S shell
is now handled correctly- โ Here docs with \r are now parsed correctly and give better warnings
๐ Changed
- ๐ Assignments are now parsed to spec, without leniency for leading $ or spaces
- โ POSIX/dash unsupported feature warnings now have individual SC3xxx codes
- SC1090: A leading
$x/
or$(x)/
is now treated as./
when locating files - โ SC2154: Variables appearing in -z/-n tests are no longer considered unassigned
- โ SC2270-SC2285: Improved warnings about misused
=
, e.g.${var}=42
-
v0.7.1 Changes
April 04, 2020๐ Fixed
-f diff
no longer claims that it found more issues when it didn't- Known empty variables now correctly trigger SC2086
- ShellCheck should now be compatible with Cabal 3
- SC2154 and all command-specific checks now trigger for builtins
called with
builtin
โ Added
- SC1136: Warn about unexpected characters after ]/]]
- SC2254: Suggest quoting expansions in case statements
- SC2255: Suggest using
$((..))
in[ 2*3 -eq 6 ]
- SC2256: Warn about translated strings that are known variables
- SC2257: Warn about arithmetic mutation in redirections
- SC2258: Warn about trailing commas in for loop elements
๐ Changed
- ๐ SC2230: 'command -v' suggestion is now off by default (-i deprecate-which)
- โ SC1081: Keywords are now correctly parsed case sensitively, with a warning
-
v0.7.0 Changes
July 28, 2019โ Added
- ๐ Precompiled binaries for macOS and Linux aarch64
- ๐ Preliminary support for fix suggestions
- ๐ New
-f diff
unified diff format for auto-fixes - โ Files containing Bats tests can now be checked
- Directory wide directives can now be placed in a
.shellcheckrc
- โ
Optional checks: Use
--list-optional
to show a list of tests, Enable with-o
flags orenable=name
directives - Source paths: Use
-P dir1:dir2
or asource-path=dir1
directive to specify search paths for sourced files. - json1 format like --format=json but treats tabs as single characters
- Recognize FLAGS variables created by the shflags library.
- Site-specific changes can now be made in Custom.hs for ease of patching
- SC2154: Also warn about unassigned uppercase variables (optional)
- SC2252: Warn about
[ $a != x ] || [ $a != y ]
, similar to SC2055 - SC2251: Inform about ineffectual ! in front of commands
- SC2250: Warn about variable references without braces (optional)
- 0๏ธโฃ SC2249: Warn about
case
with missing default case (optional) - SC2248: Warn about unquoted variables without special chars (optional)
- SC2247: Warn about $"(cmd)" and $"{var}"
- SC2246: Warn if a shebang's interpreter ends with /
- SC2245: Warn that Ksh ignores all but the first glob result in
[
- SC2243/SC2244: Suggest using explicit -n for
[ $foo ]
(optional) - SC1135: Suggest not ending double quotes just to make $ literal
๐ Changed
- If a directive or shebang is not specified, a
.bash/.bats/.dash/.ksh
extension will be used to infer the shell type when present. - Disabling SC2120 on a function now disables SC2119 on call sites
๐ Fixed
- ๐จ SC2183 no longer warns about missing printf args for
%()T
-
v0.6.0 Changes
December 02, 2018โ Added
- ๐ป Command line option --severity/-S for filtering by minimum severity
- ๐ป Command line option --wiki-link-count/-W for showing wiki links
- SC2152/SC2151: Warn about bad
exit
values like1234
and"foo"
- SC2236/SC2237: Suggest -n/-z instead of ! -z/-n
- SC2238: Warn when redirecting to a known command name, e.g. ls > rm
- SC2239: Warn if the shebang is not an absolute path, e.g. #!bin/sh
- SC2240: Warn when passing additional arguments to dot (.) in sh/dash
- ๐ SC1133: Better diagnostics when starting a line with |/||/&&
๐ Changed
- โ Most warnings now have useful end positions
- SC1117 about unknown double-quoted escape sequences has been retired
๐ Fixed
- SC2021 no longer triggers for equivalence classes like
[=e=]
- SC2221/SC2222 no longer mistriggers on fall-through case branches
- SC2081 about glob matches in
[ .. ]
now also triggers for!=
- SC2086 no longer warns about spaces in
$#
- SC2164 no longer suggests subshells for
cd ..; cmd; cd ..
read -a
is now correctly considered an array assignment- SC2039 no longer warns about LINENO now that it's POSIX
-
v0.5.0 Changes
May 31, 2018โ Added
- โ SC2233/SC2234/SC2235: Suggest removing or replacing (..) around tests
- SC2232: Warn about invalid arguments to sudo
- SC2231: Suggest quoting expansions in for loop globs
- SC2229: Warn about 'read $var'
- SC2227: Warn about redirections in the middle of 'find' commands
- SC2224/SC2225/SC2226: Warn when using mv/cp/ln without a destination
- โ SC2223: Quote warning specific to
: ${var=value}
- SC1131: Warn when using
elseif
orelsif
- SC1128: Warn about blanks/comments before shebang
- ๐ SC1127: Warn about C-style comments
๐ Fixed
- Annotations intended for a command's here documents now work
- ๐ Escaped characters inside groups in =~ regexes now parse
- Associative arrays are now respected in arithmetic contexts
- SC1087 about
$var[@]
now correctly triggers on any index - Bad expansions in here documents are no longer ignored
- ๐ FD move operations like {fd}>1- now parse correctly
๐ Changed
- ๐ Here docs are now terminated as per spec, rather than by presumed intent
- ๐ SC1073: 'else if' is now parsed correctly and not like 'elif'
- SC2163: 'export $name' can now be silenced with 'export ${name?}'
- ๐จ SC2183: Now warns when printf arg count is not a multiple of format count
-
v0.4.7 Changes
December 08, 2017โ Added
- ๐ง Statically linked binaries for Linux and Windows (see README.md)!
- โ
-a
flag to also include warnings insource
d files - SC2221/SC2222: Warn about overridden case branches
- SC2220: Warn about unhandled error cases in getopt loops
- SC2218: Warn when using functions before they're defined
- SC2216/SC2217: Warn when piping/redirecting to mv/cp and other non-readers
- SC2215: Warn about commands starting with leading dash
- SC2214: Warn about superfluous getopt flags
- SC2213: Warn about unhandled getopt flags
- SC2212: Suggest
false
over[ ]
- SC2211: Warn when using a glob as a command name
- SC2210: Warn when redirecting to an integer, e.g.
foo 1>2
- SC2206/SC2207: Suggest alternatives when using word splitting in arrays
- SC1117: Warn about double quoted, undefined backslash sequences
- SC1113/SC1114/SC1115: Recognized more malformed shebangs
๐ Fixed
[ -v foo ]
no longer warns iffoo
is undefined- SC2037 is now suppressed by quotes, e.g.
PAGER="cat" man foo
- ๐ Ksh nested array declarations now parse correctly
- Parameter Expansion without colons are now recognized, e.g.
${foo+bar}
- โ The
lastpipe
option is now respected with regard to subshell warnings \(
is now respected for grouping in[
- Leading
\
is now ignored for commands, to allow alias suppression - Comments are now allowed after directives to e.g. explain 'disable'
-
v0.4.6 Changes
March 26, 2017โ Added
- SC2204/SC2205: Warn about
( -z foo )
and( foo -eq bar )
- SC2200/SC2201: Warn about brace expansion in [/[[
- SC2198/SC2199: Warn about arrays in [/[[
- ๐ SC2196/SC2197: Warn about deprecated egrep/fgrep
- SC2195: Warn about unmatchable case branches
- SC2194: Warn about constant 'case' statements
- SC2193: Warn about
[[ file.png == *.mp3 ]]
and other unmatchables - SC2188/SC2189: Warn about redirections without commands
- ๐ SC2186: Warn about deprecated
tempfile
- SC1109: Warn when finding
&
/>
/<
unquoted - SC1108: Warn about missing spaces in
[ var= foo ]
๐ Changed
- All files are now read as UTF-8 with lenient latin1 fallback, ignoring locale
- Unicode quotes are no longer considered syntactic quotes
- โ
ash
scripts will now be checked asdash
with a warning
๐ Fixed
-c
no longer suggested when usinggrep -o | wc
- Comments and whitespace are now allowed before filewide directives
- Here doc delimiters with esoteric quoting like
foo""
are now handled - SC2095 about
ssh
in while read loops is now suppressed when using-n
- ๐จ
%(%Y%M%D)T
now recognized as a single formatter inprintf
checks grep -F
now suppresses regex related suggestions- Command name checks now recognize busybox applet names
- SC2204/SC2205: Warn about
-
v0.4.5 Changes
October 21, 2016โ Added
- ๐ A Docker build (thanks, kpankonen!)
- SC2185: Suggest explicitly adding path for
find
- SC2184: Warn about unsetting globs (e.g.
unset foo[1]
) - ๐จ SC2183: Warn about
printf
with more formatters than variables - ๐จ SC2182: Warn about ignored arguments with
printf
- SC2181: Suggest using command directly instead of
if [ $? -eq 0 ]
- โ
SC1106: Warn when using
test
operators in(( 1 -eq 2 ))
๐ Changed
- โ Unrecognized directives now causes a warning rather than parse failure.
๐ Fixed
- ๐ Indices in associative arrays are now parsed correctly
- โ Missing shebang warning squashed when specifying with a directive
- ๐ Ksh multidimensional arrays are now supported
- Variables in substring ${a:x:y} expansions now count as referenced
- SC1102 now also handles ambiguous
$((
- Using
$(seq ..)
will no longer suggest quoting - SC2148 (missing shebang) is now suppressed when using shell directives
[ a '>' b ]
is now recognized as being correctly escaped
-
v0.4.4 Changes
May 15, 2016โ Added
- ๐ Haskell Stack support (thanks, Arguggi!)
- SC2179/SC2178: Warn when assigning/appending strings to arrays
- SC1102: Warn about ambiguous
$(((
- SC1101: Warn when \ linebreaks have trailing spaces
๐ Changed
- Directives directly after the shebang now apply to the entire file
๐ Fixed
{$i..10}
is now flagged similar to{1..$i}