shellcheck/src/ShellCheck
Benjamin Gordon 474b23d6e7 SC2191: Tighten index checks
When adding a value containing an equals sign to an indexed array, the
left side is treated as an index if it looks like [N]=val and N is
numeric.  SC2191 currently warns about anything that looks like key=val
even though non-numeric values of key will never be treated as an index.
This causes spurious warnings for the common pattern of building up
program arguments in an array, such as:
  args=(
    --dry-run
    --in="${my_var}"
    --out=/some/path
    -f
  )
  /bin/program "${args[@]}"

Since only numeric expressions can be a valid index for an indexed
array, only emit SC2191 if the left side of a literal string containing
an equals looks numeric.  Other more complicated constructs should still
warn because shellcheck doesn't know if they may evaluate to a numeric
result.  Associative arrays still warn because a non-numeric left side
is a valid subscript.
2020-02-05 16:50:32 -07:00
..
Checks Merge branch 'iss1724-builtin-support' of https://github.com/jabberabbe/shellcheck into jabberabbe-iss1724-builtin-support 2019-12-21 18:13:07 -08:00
Formatter Make -f diff stop saying it found more issues when it didn't. 2019-07-28 20:50:50 -07:00
Analytics.hs SC2191: Tighten index checks 2020-02-05 16:50:32 -07:00
Analyzer.hs Make SC2230 optional 2019-12-07 16:11:49 -08:00
AnalyzerLib.hs Fix issue #1724 2019-11-01 13:49:17 +01:00
AST.hs Fix error spans for shebang warnings (fixes #1620) 2019-06-23 13:49:08 -07:00
ASTLib.hs Merge pull request #1580 from virgilwashere/copyright 2019-05-19 12:03:15 -07:00
Checker.hs 📝 Update Copyright to year 2019 and Markdown linting 2019-05-14 20:12:34 +10:00
Data.hs Make read -t 0 test more forgiving towards other flags 2019-10-12 20:45:36 -07:00
Fixer.hs Make Fixer responsible for realigning tab stops 2019-01-09 18:08:59 -08:00
Interface.hs 📝 Update Copyright to year 2019 and Markdown linting 2019-05-14 20:12:34 +10:00
Parser.hs Merge branch 'iss1724-builtin-support' of https://github.com/jabberabbe/shellcheck into jabberabbe-iss1724-builtin-support 2019-12-21 18:13:07 -08:00
Regex.hs 📝 Update Copyright to year 2019 and Markdown linting 2019-05-14 20:12:34 +10:00