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: remove backslash-newline-semicolon when it's unnecessary #959

Open
mvdan opened this issue Dec 20, 2022 · 0 comments
Open

syntax: remove backslash-newline-semicolon when it's unnecessary #959

mvdan opened this issue Dec 20, 2022 · 0 comments

Comments

@mvdan
Copy link
Owner

mvdan commented Dec 20, 2022

Take this piece of shell:

$ cat f.sh
if
	true \
	; then
	echo yes
fi
$ bash f.sh
yes
$ shfmt f.sh
if
	true \
		;
then
	echo yes
fi

Note how it runs, but shfmt didn't improve it that much. It could do better, instead producing:

$ cat f2.sh
if
	true
then
	echo yes
fi
$ bash f2.sh 
yes
$ shfmt f2.sh
if
	true
then
	echo yes
fi
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