-
-
Notifications
You must be signed in to change notification settings - Fork 349
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: insert single space before and after line comment #
#1031
Comments
Yes me too. I look forward to when shfmt adds a space for commented lines. #!/bin/bash
foo() {
# echo 1
#echo 2
# echo 3
echo 4
}
foo
true #test I expect shfmt to turn the shfmt -d format-me.sh @@ -1,7 +1,7 @@
#!/bin/bash
foo() {
-# echo 1
+ # echo 1
#echo 2
# echo 3
echo 4 |
shfmt heavily borrows from Go's gofmt, which has never forced a leading space in comments, and I personally think that's fine. Most people will prefer comments leading with one space, but nothing is particularly wrong about comments that don't. For example, what about comments starting with a tab character, what should we do with them? Or what about empty comments? |
Please see this: https://chat.openai.com/share/2fa42d22-4344-485d-acab-4c9a7847ce95 I know the tool is questionable. In this case however I used it for a quick summary. |
I won't make technical decisions based on what an AI thinks. My questions above remain. |
That openai link is now 404. |
I'd expect this
#!/usr/bin/env bash true#test
to be formatted to that
to increase readability and to be consistent to other programming languages.
The text was updated successfully, but these errors were encountered: