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

Comments in a subshell are moved every time the formatter runs #1084

Open
Ashymad opened this issue Jul 18, 2024 · 0 comments
Open

Comments in a subshell are moved every time the formatter runs #1084

Ashymad opened this issue Jul 18, 2024 · 0 comments

Comments

@Ashymad
Copy link

Ashymad commented Jul 18, 2024

Example file.sh:

#!/bin/sh
( # Comment
    true
)

Running shfmt -w -l 1st time produces (2 spaces in front of the comment):

#!/bin/sh
(  # Comment
    true
)

Running shfmt -w -l 2nd time produces (3 spaces in front of the comment):

#!/bin/sh
(   # Comment
    true
)

Every time you run shfmt adds another space in front of the comment, never satisfied with the amount of them.

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

1 participant