Releases: mvdan/sh
v1.3.1
Highlights:
- syntax
- Fix parsing of
${foo[$bar]} - Fix printer regression where
> >(foo)would be turned into>>(foo) - Break comment alignment on any line without a comment, fixing formatting issues
- Error on keywords like
fianddoneused as commands
- Fix parsing of
Binaries built on go version go1.8.3 linux/amd64.
v1.3.0
Highlights:
- syntax
- Fix backslashes in backquote command substitutions
- Disallow some test expressions like
[[ a == ! b ]] - Disallow some parameter expansions like
${$foo} - Disallow some arithmetic expressions like
((1=3))and(($(echo 1 + 2))) - Binary commands like
&&,||and pipes are now left-associative
- fileutil
CouldBeScriptmay now return true on non-regular files such as symlinks
- interp
- New experimental package to interpret a
syntax.Filein pure Go
- New experimental package to interpret a
Binaries built on go version go1.8.1 linux/amd64.
v1.2.0
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
HasShebangandCouldBeScript - Require shebangs to end with whitespace to reject
#!/bin/shfoo
- New package with some code moved from
Binaries built on go version go1.8 linux/amd64.
v1.1.0
Highlights:
- syntax
- Parse
[[ a = b ]]like[[ a == b ]], deprecatingTsAssgnin favour ofTsEqual - Add support for the
-k,-G,-Oand-Nunary operators inside[[ ]] - Add proper support for
!in parameter expansions, like${!foo} - Fix a couple of crashes found via fuzzing
- Parse
- cmd/shfmt
- Rewrite
[[ a = b ]]into the saner[[ a == b ]](see above)
- Rewrite
Binaries built on go version devel +a2b615d527 Thu Jan 5 15:37:37 2017 +0000 linux/amd64.
v1.0.0
v0.6.0
Highlights:
- syntax
Parsenow takes anio.Readerinstead of[]byte- Invalid UTF-8 is now reported as an error
- Remove backtracking for
$((and(( Walknow 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
Highlights:
- cmd/shfmt
- Remove
-cpuprofile - Don't read entire files into memory to check for a shebang
- Remove
- syntax
- Use
uint32for tokens and positions in nodes - Use
WordandLitpointers consistently instead of values - Ensure
Word.Partsis never empty - Add support for expressions in array indexing and parameter expansion slicing
- Use
Binaries built on go version devel +a2bd5c5 Thu Nov 24 03:48:45 2016 +0000 linux/amd64.
v0.4.0
Highlights:
- Merge
parser,ast,tokenandprinterinto a single packagesyntax - 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
- Allow whitespace after
- syntax
- Implement operator precedence for
[[ ]] - Parse
$(foo)andfooas the same (shfmtthen converts the latter to the former) - Rename
QuotedtoDblQuotedfor clarity - Split
((foo))nodes as their own type,ArithmCmd - Add support for bash parameter expansion slicing
- Implement operator precedence for
Binaries built on go version devel +8a2a999 Tue Nov 8 00:51:14 2016 +0000 linux/amd64.
v0.3.0
Highlights:
- Add support for bash's
coprocand extended globbing like@(foo) - Improve test coverage, adding tests to
cmd/shfmtand bringingparserandprinterclose to 100% - Support empty C-style for loops like
for ((;;)) ... - Support for the
>|redirect operand - cmd/shfmt
- Fix issue where
.shand.bashfiles might not be walked if running on a directory - Fix issue where
-pwas not obeyed when formatting stdin
- Fix issue where
- parser
$''now generates anast.SglQuoted, not anast.Quoted- Support for ambiguous
((like with$(( - Improve special parameter expansions like
$@or$! - Improve bash's
exporttypeset,namerefandreadonly <>,>&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
Highlights:
- Optimizations all around, making
shfmt~15% faster - cmd/shfmt
- Add
-pflag to only accept POSIX Shell programs (parser.PosixConformant)
- Add
- parser
- Add support for ambiguous
$((as in$((foo) | bar) - Limit more bash features to
PosixConformantbeing false - Don't parse heredoc bodies in nested expansions and contexts
- Run tests through
bashto confirm the presence of a parse error
- Add support for ambiguous
- ast
- Add
Walk(Visitor, Node)function
- Add
Binaries built on go version devel +dc46b88 Thu Oct 13 09:37:17 2016 +0000 linux/amd64.