sh v3.0.0 Release Notes

Release Date: 2019-06-05 // almost 5 years ago
  • ๐Ÿš€ This is the first stable release as a proper module, now under ๐Ÿ‘ mvdan.cc/sh/v3/.... Go 1.12 or later is supported.

    ๐Ÿš€ A large number of changes have been done since the last feature release a year โšก๏ธ ago. All users are encouraged to update. Below are the major highlights.

    • cmd/shfmt
      • Support for EditorConfig files
      • Drop the dependency on diff for the -d flag, now using pure Go
    • syntax
      • Overhaul escaped newlines, now represented as WordPart positions
      • Improve some operator type names, to consistently convey meaning
      • Completely remove StmtList
      • Redesign IfClause, making its "else" another IfClause node
      • Redesign DeclClause to remove its broken Opts field
      • Brace expression parsing is now done with a BraceExp word part
      • Improve comment alignment in Printer via a post-process step
      • Add support for the ~ bitwise negation operator
      • Record the use of deprecated tokens in the syntax tree
    • interp
      • Improve the module API as "handlers", to reduce confusion with Go modules
      • Split LookPath out of ExecHandler to allow custom behavior
      • Run now returns nil instead of ShellExitStatus(0)
      • OpenDevImpls is removed; see ExampleOpenHandler for an alternative
    • expand
      • Redesign Variable to reduce allocations
      • Add support for more escape sequences
      • Make Config a bit more powerful via func fields
      • Rework brace expansion via the new BraceExp word part
    • pattern
      • New package for shell pattern matching, extracted from syntax
      • Add support for multiple modes, including filenames and braces

    ๐Ÿš€ Special thanks to Konstantin Kulikov for his contribution to this release.