-
Notifications
You must be signed in to change notification settings - Fork 42
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
Indentation stripped from elif statements #57
Comments
Able to replicate this with docker and ubuntu eoan, python3 and beautysh 6.0.1
|
Replicated with beautysh 6.0.1. |
Proposed fix for issue 57 (lovesegfault#57). Tested in my local environment and working there.
It seems to matter whether exactly where the
Run on this script, beautysh 6.0.1 incorrectly outdents the
If I strip
|
I wonder if we just want to enforce the linebreak between Fundamentally, the regex-based approach beautysh takes is insufficient to correctly handle all of bash. If I were to rewrite it today I would parse the bash script with |
I think we can fix this by making the ad-hoc outdent only apply to |
Make the ad-hoc oudent (added in lovesegfault#2) apply only when `elif` is followed by `then` on the same line. In my testing, this addresses lovesegfault#57 without breaking the lovesegfault#2 test case. I'm sure the regex could be cleaned up, though.
Looks as though the actual issue is that lines containing So if you have By making the second (ad-hoc) |
`elif` test case to address both lovesegfault#2 and lovesegfault#57.
…vesegfault#57) Make the ad-hoc oudent (added in lovesegfault#2) apply only when `elif` is followed by `then` on the same line. In my testing, this addresses lovesegfault#57 without breaking the lovesegfault#2 test case. Test case to be added in lovesegfault#76
Fixed in #75 thanks to @trystero11! |
Hello, I seem to have encountered an issue which seems to be the inverse of #2
With the given block of code (tabs or spaces):
When run through beautysh ( 4.1 or 5.0.2 ), indentation is stripped at elif:
The text was updated successfully, but these errors were encountered: