Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: if statement indented wrong when de-indenting and using -kp #286

Closed
arp242 opened this issue Sep 2, 2018 · 1 comment
Closed
Assignees
Milestone

Comments

@arp242
Copy link

arp242 commented Sep 2, 2018

There is an extra space in front of the if when shfmt de-indents code that is indented too much:

[~]% cat test.sh
        if :; then
                :
        fi

[~]% shfmt test.sh
if :; then
        :
fi

[~]% shfmt -kp test.sh
 if :; then
         :
fi
@mvdan
Copy link
Owner

mvdan commented Sep 7, 2018

-kp isn't meant to change indentation, so this is a bug. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants