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

fix: 416 python hanging comma #566

Merged
merged 5 commits into from
Oct 26, 2024

Conversation

Alex-ley-scrub
Copy link
Contributor

@Alex-ley-scrub Alex-ley-scrub commented Oct 26, 2024

/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:

cargo test --package marzano-core --lib -- --exact --show-output
cargo test --package marzano-core --lib -- test::trailing_comma_after_argument_removal --exact --show-output
cargo test --package marzano-core --lib -- test::trailing_comma_after_argument_removal_one_line --exact --show-output

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

@Alex-ley-scrub Alex-ley-scrub requested a review from a team as a code owner October 26, 2024 22:32
Copy link

@greptile-apps greptile-apps bot left a 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

// 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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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 👌

Copy link
Contributor

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.

@morgante morgante merged commit e12de3b into getgrit:main Oct 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hanging commas after removing kwargs in Python
2 participants