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

[bug] [formatter] parenthesized single list comp var chokes formatter #8053

Closed
smackesey opened this issue Oct 18, 2023 · 1 comment · Fixed by #8054
Closed

[bug] [formatter] parenthesized single list comp var chokes formatter #8053

smackesey opened this issue Oct 18, 2023 · 1 comment · Fixed by #8054
Assignees
Labels
bug Something isn't working

Comments

@smackesey
Copy link

The below line is legal python but chokes the formatter:

    return all(filepath.startswith(DAGIT_CLOUD_PATH) for (filepath) in diff_files)

Error:

error: Failed to format .buildkite/utils.py: syntax error: Expected `in` keyword between the `target` and `iter`.
@charliermarsh
Copy link
Member

Taking a look now.

@charliermarsh charliermarsh self-assigned this Oct 18, 2023
@charliermarsh charliermarsh added the bug Something isn't working label Oct 18, 2023
charliermarsh added a commit that referenced this issue Oct 18, 2023
## Summary

Given an expression like `[x for (x) in y]`, we weren't skipping over
parentheses when searching for the `in` between `(x)` and `y`.

Closes #8053.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants