Releases: mvdan/sh
v3.1.1
Highlights:
- cmd/shfmt
- Recognise
function_next_linein EditorConfig files
- Recognise
- syntax
- Don't ignore escaped newlines at the end of heredoc bodies
- Improve support for parsing regexes in test expressions
- Count columns for
KeepPaddingin bytes, to better support unicode - Never let
KeepPaddingadd spaces right after indentation
- interp
- Hide unset variables when executing programs
Binaries built on go version go1.14.2 linux/amd64.
v3.1.0
Highlights:
- Redesigned Docker images, including buildx and an Alpine variant
- cmd/shfmt
- Replace source files atomically when possible
- Support
ignore = truein an EditorConfig to skip directories - Add
-fnto place function opening braces on the next line - Improve behavior of
-fwhen given non-directories - Docker images and
go getinstalls now embed good version information
- syntax
- Add support for nested here-documents
- Allow parsing for loops with braces, present in mksh and Bash
- Expand
CaseClauseto describe itsintoken - Allow empty lines in Bash arrays in the printer
- Support disabling
KeepPadding - Avoid mis-printing some programs involving
&
- interp
- Add initial support for Bash process substitutions
- Add initial support for aliases
- Fix an edge case where the status code would not be reset
- The exit status code can now reflect being stopped by a signal
test -tnow uses the interpreter's stdin/stdout/stderr files
- expand
- Improve the interaction of
@and*with quotes andIFS
- Improve the interaction of
Binaries built on go version go1.14.2 linux/amd64.
Please note that the binaries were re-uploaded on April 10th, to update the Go version and fix the missing version information.
v3.0.2
Highlights:
- syntax
- Don't indent after escaped newlines in heredocs
- Don't parse
*[i]=xas a valid assignment
- interp
- Prevent subshells from defining funcs in the parent shells
- expand
- Parameters to
Fieldsno longer get braces expanded in-place
- Parameters to
Binaries built on go version go1.13.8 linux/amd64.
v3.0.1
Highlights:
- cmd/shfmt
- Fix an edge case where walking directories could panic
- syntax
- Only do a trailing read in
Parser.Stmtsif we have open heredocs - Ensure comments are never folded into heredocs
- Properly tokenize
)after a=~test regexp - Stop parsing a comment at an escaped newline
- Only do a trailing read in
- expand
"$@"now expands to zero fields when there are zero parameters
Binaries built on go version go1.13.5 linux/amd64.
v3.0.0
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
difffor the-dflag, now using pure Go
- syntax
- Overhaul escaped newlines, now represented as
WordPartpositions - Improve some operator type names, to consistently convey meaning
- Completely remove
StmtList - Redesign
IfClause, making its "else" anotherIfClausenode - Redesign
DeclClauseto remove its brokenOptsfield - Brace expression parsing is now done with a
BraceExpword part - Improve comment alignment in
Printervia a post-process step - Add support for the
~bitwise negation operator - Record the use of deprecated tokens in the syntax tree
- Overhaul escaped newlines, now represented as
- interp
- Improve the module API as "handlers", to reduce confusion with Go modules
- Split
LookPathout ofExecHandlerto allow custom behavior Runnow returnsnilinstead ofShellExitStatus(0)OpenDevImplsis removed; seeExampleOpenHandlerfor an alternative
- expand
- Redesign
Variableto reduce allocations - Add support for more escape sequences
- Make
Configa bit more powerful viafuncfields - Rework brace expansion via the new
BraceExpword part
- Redesign
- pattern
- New package for shell pattern matching, extracted from
syntax - Add support for multiple modes, including filenames and braces
- New package for shell pattern matching, extracted from
Special thanks to Konstantin Kulikov for his contribution to this release.
v3.0.0-beta1
This is one of the final pre-releases before v3.0.0. See the changelog for a summary of the included changes: https://github.com/mvdan/sh/blob/v3.0.0-beta1/CHANGELOG.md#unreleased
v2.6.4
Highlights:
- syntax
- Support array elements without values, like
declare -A x=([index]=) - Parse
for i; do ...uniquely, as it's short forfor i in "$@" - Add missing error on unclosed nested backquotes
- Support array elements without values, like
- expand
- Don't expand tildes twice, fixing
echo ~on Windows
- Don't expand tildes twice, fixing
- interp
- Fix the use of
Paramsas an option toNew - Support lowercase Windows volume names in
$PATH
- Fix the use of
Binaries built on go version go1.12 linux/amd64.
v2.6.3
v2.6.2
Highlights:
- syntax
- Avoid premature reads in
Parser.Interactivewhen parsing Unicode bytes - Fix parsing of certain Bash test expression involving newlines
Redirect.Endnow takes theHdocfield into accountValidNamenow returnsfalsefor an empty string
- Avoid premature reads in
- expand
- Environment variables on Windows are case insensitive again
- interp
- Don't crash on
declare $unset=foo - Fix a regression where executed programs would receive a broken environment
- Don't crash on
Note that the published Docker image was changed to set shfmt as the entrypoint, so previous uses with arguments like docker run mvdan/shfmt:v2.6.1 shfmt --version should now be docker run mvdan/shfmt:v2.6.2 --version.
Binaries built on go version go1.11.2 linux/amd64.