Closed philsc closed 2 years ago
Yep, this is a known limitation of the parser; see https://github.com/mvdan/sh/issues/558. It is fixable, but not trivially so, as it requires support for ambiguous syntax parsing (e.g. backtracking).
Is there a way via a comment or something to disable formatting on a certain line?
Similar to clang-format's // clang-format: off
?
I'm afraid not, but you can split your code between multiple files as an alternative.
The following script is rejected by
shfmt
:The intent is to glob up all the patch files generated with
git format-patch
.We get this error:
I'm assuming that it thinks we're using associative arrays here.
This is on the latest version as far as I can tell: