Describe the bug
Autofix on Python seems to sometimes eat parentheses and brackets, making code very semantically different
To Reproduce
https://semgrep.live/2Y0
^ this is a simple repro, where I'm trying to replace
self.assertEquals(foo(), 1) with assert foo() == 1, but I end up with assert foo == 1.
(I would have labelled this issue but I don't seem to have the right permissions...)
Thanks @rtpg for the issue. We鈥檙e on it. What timeline do you like a fix? Does the end of the week work ok if it鈥檚 a minor fix?
Nothing is burning of course, but if you are able to provide even a minor fix I would be able to run this across a pretty large codebase and report back on how successful the patch is.
very cool. We'll get on it!
@DrewDennison if there ends up being even a WIP branch that potentially fixes this, I'm willing to try running out to confirm that it doesn't introduce any issues. Please freel free to ping me
Yep, it is more difficult than expected. Hopefully we can get a fix in the next few weeks.
@rtpg This is fixed now for the sample provided. Mind taking a look and letting us know as you run in issues?
https://semgrep.live/r650/ Based on this example, this issue is still not really fixed for brackets.

(Basically the brackets disappear upon being replaced, does some especially nasty stuff on JSON objects)
@rtpg Thank you for the follow-up and excellent live example. I opened https://github.com/returntocorp/semgrep/issues/1285 to track further fixes here 馃檹
Most helpful comment
very cool. We'll get on it!