ShellCheck v0.7.2 Release Notes

Release Date: 2021-04-19 // 8 months ago
  • ➕ 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

Previous changes from v0.7.1

  • 🛠 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