mirror of https://github.com/astral-sh/ruff
Fix infinite loop due to rules `D207` & `W605` (#3609)
This commit is contained in:
parent
4892167217
commit
474aa0b196
|
|
@ -114,7 +114,10 @@ pub fn invalid_escape_sequence(
|
||||||
Range::new(location, end_location),
|
Range::new(location, end_location),
|
||||||
);
|
);
|
||||||
if autofix {
|
if autofix {
|
||||||
diagnostic.amend(Fix::insertion(r"\".to_string(), location));
|
diagnostic.amend(Fix::insertion(
|
||||||
|
r"\".to_string(),
|
||||||
|
Location::new(location.row(), location.column() + 1),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
diagnostics.push(diagnostic);
|
diagnostics.push(diagnostic);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 2
|
row: 2
|
||||||
column: 9
|
column: 10
|
||||||
end_location:
|
end_location:
|
||||||
row: 2
|
row: 2
|
||||||
column: 9
|
column: 10
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
name: InvalidEscapeSequence
|
name: InvalidEscapeSequence
|
||||||
|
|
@ -37,10 +37,10 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 6
|
row: 6
|
||||||
column: 0
|
column: 1
|
||||||
end_location:
|
end_location:
|
||||||
row: 6
|
row: 6
|
||||||
column: 0
|
column: 1
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
name: InvalidEscapeSequence
|
name: InvalidEscapeSequence
|
||||||
|
|
@ -57,10 +57,10 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 11
|
row: 11
|
||||||
column: 5
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 11
|
row: 11
|
||||||
column: 5
|
column: 6
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
name: InvalidEscapeSequence
|
name: InvalidEscapeSequence
|
||||||
|
|
@ -77,9 +77,9 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 18
|
row: 18
|
||||||
column: 5
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 18
|
row: 18
|
||||||
column: 5
|
column: 6
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 2
|
row: 2
|
||||||
column: 9
|
column: 10
|
||||||
end_location:
|
end_location:
|
||||||
row: 2
|
row: 2
|
||||||
column: 9
|
column: 10
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
name: InvalidEscapeSequence
|
name: InvalidEscapeSequence
|
||||||
|
|
@ -37,10 +37,10 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 6
|
row: 6
|
||||||
column: 0
|
column: 1
|
||||||
end_location:
|
end_location:
|
||||||
row: 6
|
row: 6
|
||||||
column: 0
|
column: 1
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
name: InvalidEscapeSequence
|
name: InvalidEscapeSequence
|
||||||
|
|
@ -57,10 +57,10 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 11
|
row: 11
|
||||||
column: 5
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 11
|
row: 11
|
||||||
column: 5
|
column: 6
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
name: InvalidEscapeSequence
|
name: InvalidEscapeSequence
|
||||||
|
|
@ -77,9 +77,9 @@ expression: diagnostics
|
||||||
content: "\\"
|
content: "\\"
|
||||||
location:
|
location:
|
||||||
row: 18
|
row: 18
|
||||||
column: 5
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 18
|
row: 18
|
||||||
column: 5
|
column: 6
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue