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

E703: semicolon followed by ellipsis causes syntax error #5154

Closed
Tracked by #4972
addisoncrump opened this issue Jun 17, 2023 · 1 comment · Fixed by #5174
Closed
Tracked by #4972

E703: semicolon followed by ellipsis causes syntax error #5154

addisoncrump opened this issue Jun 17, 2023 · 1 comment · Fixed by #5174
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@addisoncrump
Copy link
Contributor

This one is fairly straightforward, and potentially indicates other issues with E703.

The original source:

while 1:
  1;...

And the ruff output:

error: Autofix introduced a syntax error in `minimized-from-crash-70aec6f79bd62d88` with rule codes E703: invalid syntax. Got unexpected token '.' at byte offset 14
---
while 1:
  1...

---
minimized-from-crash-70aec6f79bd62d88:2:4: E703 Statement ends with an unnecessary semicolon
  |
1 | while 1:
2 |   1;...
  |    ^ E703
  |
  = help: Remove unnecessary semicolon

Found 1 error.
@charliermarsh
Copy link
Member

We might just want to remove this fix for now. It'll be made obsolete by the formatter anyway, and it's probably tricky to get right at the moment.

@charliermarsh charliermarsh self-assigned this Jun 19, 2023
charliermarsh added a commit that referenced this issue Jun 19, 2023
## Summary

We weren't resetting the `allow_ellipsis` flag properly, which
ultimately caused us to treat the semicolon as "unnecessary" rather than
"creating a multi-statement line".

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

Successfully merging a pull request may close this issue.

2 participants