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
Ignore the fact that true could fit on one line -- the real code is a condition long enough to require line breaks to fit.
It's worth noting that part of me was also surprised that shfmt doesn't emit if [[ true ]] -- but that's separate to the issue of a trailing whitespace.
The text was updated successfully, but these errors were encountered:
Seeing something similar (using 3.8.0) for multi-line sub-shells even though .editorconfig says to trim them.
Original code is something like
(some_very_long_command | sed '$d';
another_longish_command | tac;echo Hello)
On the first shfmt invocation, that becomes
(
some_very_long_command | sed '$d';
another_longish_command | tac;echo Hello
)
conform indent_size = 4 in .editorconfig, without any trailing spaces.
Re-running shfmt introduces three spaces after the first parenthesis, i.e spaces to line up with some_very_long_command.
In case it matters, shfmt runs from the directory that contains .editorconfig on a script in a subdirectory.
Input
Expected
Actual
Note the trailing whitespace after the
[[
Repro command
Additional Information
Ignore the fact that
true
could fit on one line -- the real code is a condition long enough to require line breaks to fit.It's worth noting that part of me was also surprised that shfmt doesn't emit
if [[ true ]]
-- but that's separate to the issue of a trailing whitespace.The text was updated successfully, but these errors were encountered: