You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would expect that the (admittedly contrived example) would be corrected to:
a= \
5
Instead, it is corrected to:
a=
This completely removes the second half of the expression on the continuation.
thread '<unnamed>' panicked at 'Fixed source has a syntax error where the source document does not. This is a bug in one of the generated fixes:
<filename>:1:5: E999 SyntaxError: Unexpected token Newline
|
1 | a =
| ^ E999
|
Last generated fixes:
<filename>:2:4: E703 [*] Statement ends with an unnecessary semicolon
|
1 | a = \
2 | 5;
| ^ E703
|
= help: Remove unnecessary semicolon
ℹ Fix
1 |-a = \
2 |- 5;
1 |+a =
Source with applied fixes:
a =
', /home/addisoncrump/git/ruff/crates/ruff/src/test.rs:202:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted
The text was updated successfully, but these errors were encountered:
## Summary
Previously, given:
```python
a = \
5;
```
When detecting continuations starting at the offset of the `;`, we'd
flag the previous line as a continuation. We should only flag a
continuation if there isn't leading content prior to the offset.
Closes#6214
Consider the following snippet:
We would expect that the (admittedly contrived example) would be corrected to:
Instead, it is corrected to:
This completely removes the second half of the expression on the continuation.
The text was updated successfully, but these errors were encountered: