Repository navigation
Releases
v3.6.0
This release drops support for Go 1.17 and includes many features and fixes.
- cmd/shfmt
- syntax
- Don't require peeking two bytes after
echo *- #835 - Simplify
${name:-}to the equivalent${name-}- #849 - Don't print trailing whitespaces on nested subshells - #814
- Don't print extra newlines in some case clauses - #779
- Don't indent comments preceding case clause items - #917
- Allow escaped newlines before unquoted words again - #873
- Parse a redirections edge case without spaces - #879
- Give a helpful error when
<<<is used in POSIX mode - #881 - Forbid
${!foo*}and${!foo@}in mksh mode - #929 - Batch allocations less aggressively in the parser
- Don't require peeking two bytes after
- syntax/typedjson
- Expose
--from-jsonand--to-jsonas Go APIs - #885
- Expose
- expand
- interp
- pattern
- Add
EntireStringto match the entire string using^$- #866
- Add
A special thanks to all the contributors to this release!
@fauust @graf0 @hristiy4n @ihar-orca @lollipopman @mkhl @przmv @reubeno @riacataquian @scop @tmillr
Binaries built on go version go1.19.4 linux/amd64 with:
CGO_ENABLED=0 go build -trimpath -ldflags="-w -s -X=main.version=v3.6.0"
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.5.1
This release was tagged two weeks ago; we forgot to do the GitHub release with prebuilt binaries.
- cmd/shfmt
- Fix the Docker publishing script bug which broke 3.5.0 - #860
- interp
- pattern
Regexpnow returns the typed errorSyntaxError- #862
Binaries built on go version go1.18.3 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.5.0
This release drops support for Go 1.16 and includes many new features.
- cmd/shfmt
- Switch to
-ln=autoby default to detect the shell language - Add support for long flags, like
--indentfor-i
- Switch to
- syntax
- Allow extglob wildcards as function names like
@() { ... } - Add support for heredocs surrounded by backquotes
- Add support for backquoted inline comments
- Add
NewPosto createPosvalues externally - Support escaped newlines with CRLF line endings
Minifyno longer omits a leading shebang comment- Avoid printing escaped newlines in non-quoted words
- Fix some printer edge cases where comments weren't properly spaced
- Allow extglob wildcards as function names like
- fileutil
- Add
Shebangto extract the shell language from a#!line
- Add
- expand
- Reimplement globstar
**globbing for correctness - Replace
os.Statas the last direct use of the filesystem
- Reimplement globstar
- interp
- Add
CallHandlerto intercept all interpretedCallExprnodes - Add
ReadDirHandlerto intercept glob expansion filesystem reads - Add
StatHandlerto interceptos.Statandos.Lstatcalls - Always surface exit codes from command substitutions
- Add initial and incomplete support for
set -x - Add support for
cd -ascd "$OLDPWD" - Avoid panic on
set - args
- Add
Binaries built on go version go1.18.2 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.4.3
- cmd/shfmt
- New Docker
v3tag to track the latest stable version - Don't duplicate errors when walking directories
- New Docker
- interp
- Properly handle empty paths in the
testbuiltin - Allow unsetting global vars from inside a function again
- Use
%wto wrap errors inDir
- Properly handle empty paths in the
Binaries built on go version go1.17.7 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.4.2
- syntax
- Don't return an empty string on empty input to
Quote
- Don't return an empty string on empty input to
- expand
- Properly sort in
ListEnvironto avoid common prefix issues
- Properly sort in
- interp
exportused in functions now affects the global scope- Support looking for scripts in
$PATHinsource - Properly slice arrays in parameter expansions
Binaries built on go version go1.17.5 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.4.1
- syntax
- Don't return an empty string on empty input to
Quote
- Don't return an empty string on empty input to
- expand
- Properly sort in
ListEnvironto avoid common prefix issues
- Properly sort in
- interp
exportused in functions now affects the global scope- Support looking for scripts in
$PATHinsource - Properly slice arrays in parameter expansions
Binaries built on go version go1.17.3 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.4.0
This release drops support for Go 1.15, which allows the code to start benefitting from io/fs.
- cmd/shfmt
- Walks directories ~10% faster thanks to
filepath.WalkDir
- Walks directories ~10% faster thanks to
- syntax
- Add
Quoteto mirrorstrconv.Quotefor shell syntax - Skip null characters when parsing, just like Bash
- Rewrite fuzzers with Go 1.18's native fuzzing
- Add
- fileutil
- Add
CouldBeScript2usingio/fs.DirEntry
- Add
- expand
- Skip or stop at null characters, just like Bash
- interp
- Set
GIDjust likeUID - Add support for
read -p - Add support for
pwdflags - Create random FIFOs for process substitutions more robustly
- Avoid leaking an open file when interpreting
$(<file)
- Set
Binaries built on go version go1.17.1 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.3.1
Highlights:
- syntax
- Don't convert
&in a separate line into; - Fix a
BinaryNextLineedge case idempotency bug - Never start printing a command with an escaped newline
- Don't convert
- interp
- Support calling
Runner.ResetbeforeRunner.Run - Obey
set -efor failed redirections
- Support calling
Binaries built on go version go1.16.6 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.3.0
Highlights:
- cmd/shfmt
- Document the
FORCE_COLORenv var to always use colors in diffs
- Document the
- syntax
- Add the printer
SingleLineoption to avoid printing newlines - Positions now use more bits for line numbers than column numbers
- Test operators like
&&and||no longer escape newlines - Properly handle closing backquotes in a few edge cases
- Properly handle trailing escaped newlines in heredocs
- Add the printer
- interp
- Redesigned variable scoping to fix a number of edge cases
- Refactor
set -o nounsetsupport to fix many edge cases - Deprecate
LookPathin favor ofLookPathDir - Array element words are now expanded correctly
- Add support for
trapwith error and exit signals - Add support for
shopt -s nullglob - Add support for
type -p
Binaries built on go version go1.16.4 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!
v3.2.4
Highlights:
- cmd/shfmt
- Don't stop handling arguments when one results in a failure
- expand
- Don't panic when a backslash is followed by EOF
Binaries built on go version go1.16 linux/amd64 via a shell script.
Consider becoming a sponsor if you benefit from the work that went into this release!