-
Notifications
You must be signed in to change notification settings - Fork 43
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
fixed broken function beautify if there are any non alphanumeric char… #72
base: master
Are you sure you want to change the base?
Conversation
…achters in the function name (fns with dashes in them for instance, will be broken on beautifying). This very small regex change seems to fix the issue, and from my testing seems to work in all test cases I could come up with (all function styles, etc).
Thanks for the fix! Would you mind taking a look at the failing tests? It seems like it has changed the behavior of some formatting around functions |
Sure, ill take a look asap! I was going to come up with a better regex then just a
|
space after function
another space missing!
revert
…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
This reverts commit 449bd97.
I reworked the test infrastructure a bit. If you want to rebase, you might have an easier time working in the codebase :) |
…achters in the function name (fns with dashes in them for instance, will be broken on beautifying). This very small regex change seems to fix the issue, and from my testing seems to work in all test cases I could come up with (all function styles, etc).
space after function
another space missing!
revert
Nice! I will give it a try again sometime soon :-] I am not a regular python user (although of course every programmer knows at least some python ), thus it is taking me forever to just fix a simple regex replacement 🤣 |
First off thank you for this program, I use it all the time and love it!
I just happened to notice that when you have functions with any non alphanumeric characters in them, it breaks those functions upon beautifying (and happens with all function styles).
A few examples would be:
etc...
(and they end up looking (something) like this:
do () -function test ()
I was able to fix this by a small regex change (replace
\w
with.
) and it seems to resolve this bug. I didn't extensively test it, but things seem to work well with all the test cases I could come up with.I hope this solution helps, or at least brings the issue to light so it can be resolved! (you may have a better way of fixing it...who knows :-) )
best, Jared