-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix: 416 python hanging comma #566
fix: 416 python hanging comma #566
Conversation
…/416-python-hanging-comma
…lti line hanging comma after removing kwargs fixes getgrit#416
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
crates/language/src/python.rs
Outdated
// https://github.com/getgrit/gritql/issues/416 multi line example | ||
if let Some(prev) = n.node.prev_sibling() { | ||
let empty = prev.range().end_byte() == prev.range().start_byte(); | ||
if prev.kind() == "identifier" && empty { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the identifier restriction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, actually we don't: dcfcf4d
that also passes all tests locally
I had gone down a few different rabbit holes / routes trying to make this work whilst ensuring all other tests passed as expected - one test that broke with one of my approaches was test_notebooks::test_insertion
so I was trying to make it pretty strict but actually asserting that the previous node is empty is pretty strict and makes sense for this issue 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, looks like this passes everything. I agree that empty is probably the best check.
…v node is empty fixes getgrit#416
/claim #416
fixes #416
follows on from PR #419 and uses those test cases but makes the multi line example also work
verified fix with:
Greptile Summary
This is an auto-generated summary
Hi! Looks like you've reached your API usage limit. You can increase it from your account settings page here: app.greptile.com/settings/usage