Skip to content

Releases: mvdan/sh

v1.2.0

22 Feb 12:22
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Add support for escaped characters in bash regular expressions
  • fileutil
    • New package with some code moved from cmd/shfmt, now importable
    • New funcs HasShebang and CouldBeScript
    • Require shebangs to end with whitespace to reject #!/bin/shfoo

Binaries built on go version go1.8 linux/amd64.

v1.1.0

05 Jan 19:32
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Parse [[ a = b ]] like [[ a == b ]], deprecating TsAssgn in favour of TsEqual
    • Add support for the -k, -G, -O and -N unary operators inside [[ ]]
    • Add proper support for ! in parameter expansions, like ${!foo}
    • Fix a couple of crashes found via fuzzing
  • cmd/shfmt
    • Rewrite [[ a = b ]] into the saner [[ a == b ]] (see above)

Binaries built on go version devel +a2b615d527 Thu Jan 5 15:37:37 2017 +0000 linux/amd64.

v1.0.0

13 Dec 15:04
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Stable release, API now frozen
    • Parse now reads input in chunks of 1KiB
  • cmd/shfmt
    • Add -version flag

Binaries built on go version devel +3fb1e0b Tue Dec 13 13:42:41 2016 +0000 linux/amd64.

v0.6.0

05 Dec 15:31
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release

Highlights:

  • syntax
    • Parse now takes an io.Reader instead of []byte
    • Invalid UTF-8 is now reported as an error
    • Remove backtracking for $(( and ((
    • Walk now takes a func literal to simplify its use

Binaries built on go version devel +ed0b232 Mon Dec 5 03:53:56 2016 +0000 linux/amd64.

v0.5.0

24 Nov 22:32
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

Highlights:

  • cmd/shfmt
    • Remove -cpuprofile
    • Don't read entire files into memory to check for a shebang
  • syntax
    • Use uint32 for tokens and positions in nodes
    • Use Word and Lit pointers consistently instead of values
    • Ensure Word.Parts is never empty
    • Add support for expressions in array indexing and parameter expansion slicing

Binaries built on go version devel +a2bd5c5 Thu Nov 24 03:48:45 2016 +0000 linux/amd64.

v0.4.0

08 Nov 13:15
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

Highlights:

  • Merge parser, ast, token and printer into a single package syntax
  • Use separate operator types in nodes rather than Token
  • Use operator value names that express their function
  • Keep ; if on a separate line when formatting
  • cmd/shfmt
    • Allow whitespace after #! in a shebang
  • syntax
    • Implement operator precedence for [[ ]]
    • Parse $(foo) and foo as the same (shfmt then converts the latter to the former)
    • Rename Quoted to DblQuoted for clarity
    • Split ((foo)) nodes as their own type, ArithmCmd
    • Add support for bash parameter expansion slicing

Binaries built on go version devel +8a2a999 Tue Nov 8 00:51:14 2016 +0000 linux/amd64.

v0.3.0

26 Oct 07:52
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

Highlights:

  • Add support for bash's coproc and extended globbing like @(foo)
  • Improve test coverage, adding tests to cmd/shfmt and bringing parser and printer close to 100%
  • Support empty C-style for loops like for ((;;)) ...
  • Support for the >| redirect operand
  • cmd/shfmt
    • Fix issue where .sh and .bash files might not be walked if running on a directory
    • Fix issue where -p was not obeyed when formatting stdin
  • parser
    • $'' now generates an ast.SglQuoted, not an ast.Quoted
    • Support for ambiguous (( like with $((
    • Improve special parameter expansions like $@ or $!
    • Improve bash's export typeset, nameref and readonly
    • <>, >& and <& are valid POSIX
    • Support for bash's ^, ^^, , and ,, operands inside ${}

Binaries built on go version devel +517a44d Tue Oct 25 12:23:49 2016 +0000 linux/amd64.

Also, binaries are now smaller thanks to -ldflags='-s -w'.

v0.2.0

13 Oct 18:04
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

Highlights:

  • Optimizations all around, making shfmt ~15% faster
  • cmd/shfmt
    • Add -p flag to only accept POSIX Shell programs (parser.PosixConformant)
  • parser
    • Add support for ambiguous $(( as in $((foo) | bar)
    • Limit more bash features to PosixConformant being false
    • Don't parse heredoc bodies in nested expansions and contexts
    • Run tests through bash to confirm the presence of a parse error
  • ast
    • Add Walk(Visitor, Node) function

Binaries built on go version devel +dc46b88 Thu Oct 13 09:37:17 2016 +0000 linux/amd64.

v0.1.0

20 Sep 15:03
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

Initial release.

Binaries built on go version devel +3cca069 Mon Sep 19 19:46:09 2016 +0000 linux/amd64.