-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
shfmt should repair tab indented here docs. #758
Comments
Can you clarify what you mean by "repair"? Perhaps give me an input file and how you run shfmt on it, and what you expect the output to be. |
Given# spaces not tab.
fun() {
cat <<-DOC
some important text
DOC
}
for i in {1..10}; do
echo "run $i"
fun
done When you run:shfmt -i 4 -s script-with-spaces.bash I would expect:# spaces not tab.
fun() {
cat <<-DOC
some important text
DOC
}
for i in {1..10}; do
echo "run $i"
fun
done But I get:
Basically, |
Hmm. I think your suggestion falls under the kind of tool to spot bugs or auto-fix common shell mistakes. You could certainly build a tool like that on top of our Go syntax package. For instance, if that tool runs the parser and encounters |
I'm going to close this as per the last comment. If someone wants to coordinate writing such a "fix common mistakes" tool, please feel free to open an umbrella issue or discussion on this repository, like #730. Thanks! |
From the bash man page:
Given this:
... I would like
shfmt
to repair this... because a lot of editors have a hard time with this if you're using spaces for indentation overall.The text was updated successfully, but these errors were encountered: