Closed ColemanTom closed 2 years ago
Thanks for raising this; I'm fairly sure this is an unintended regression.
Err, I actually wrote a complete fix for this three weeks ago, and I was sure I had already merged it to master. Somehow, I kept it in a local branch and completely forgot about it :) See https://github.com/mvdan/sh/pull/896.
I have just noticed that recently
shfmt
has changed expectations about strings. My guess is it relates to https://github.com/mvdan/sh/pull/837/commits/4556b2f2a22aa51bcfa4e5fde67ed5a89eccab78I was wondering if this was expected/desired behaviour?
Originally this was fine for
shfmt
(at least with v3.4.2)Now
shfmt
wants to change it toMy personal view is the original was more readable. Otherwise changing it to something like what I have below is possibly clearer still (at least for python devs).