You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In relation to #1273 and the above comment, the said section is not up to date with the 3.13.0 behavior. I'm not sure if this is an inadvertent change after 3.12.0, or a documentation issue. so seeking to clarify. Specifically the last example:
3.13.0 does not emit ${array[dash - string]}, but ${array[dash-string]}. (It does that also for ${array[dash - string]} input.)
I don't quite follow how this formatting change follows from the caveats section -- to me it could end up either with or without spaces and still satisfy what was said in the caveats?
The other example outputs are also slightly outdated, as they lack some backticks. #1315 updates them all.
I'm mainly seeking to clarify if this change is intentional before upgrading to 3.13.0 as it's not mentioned in the release notes. (I don't have a particular preference towards spaces vs no spaces in this case, but I do prefer consistency unless there's an intentional and preferably documented change.)
Incredible that this was not covered by any tests even though we had an example in the README. Well, we have tests now. Thanks @scop for catching this. Regardless of what format is best, I didn't intend this change, and it was unnecessary diff noise for downstreams, so it's now fixed.
Activity
scop commentedon Apr 2, 2026
One example: bash-completion sources are currently formatted with 3.12.0. Reformatting them with 3.13.0 causes a bunch of these mentioned changes: https://github.com/scop/bash-completion/actions/runs/23769811310/job/69258324432
I'm mainly seeking to clarify if this change is intentional before upgrading to 3.13.0 as it's not mentioned in the release notes. (I don't have a particular preference towards spaces vs no spaces in this case, but I do prefer consistency unless there's an intentional and preferably documented change.)
LangLangBart commentedon Apr 2, 2026
might have been unintentionally caused by 8c73583
sh/syntax/printer.go
Lines 720 to 722 in e97b2b0
mvdan commentedon Apr 2, 2026
@LangLangBart is on the money, this was an unintentional change in 8c73583. I'll take a look.
syntax: add test cases for issue #1314
mvdan commentedon Apr 2, 2026
Incredible that this was not covered by any tests even though we had an example in the README. Well, we have tests now. Thanks @scop for catching this. Regardless of what format is best, I didn't intend this change, and it was unnecessary diff noise for downstreams, so it's now fixed.
syntax: only make index expressions compact when it's a comma
fix(deps): update module mvdan.cc/sh/v3 to v3.13.1 (#397)
chore(deps): update module mvdan.cc/sh/v3/cmd/shfmt to v3.13.1 (hetzn…
syntax: keep array subscripts compact when written without spaces