Skip to content

Commit

Permalink
Fix infinite loop due to rules D207 & W605
Browse files Browse the repository at this point in the history
  • Loading branch information
Ville Lindholm committed Mar 19, 2023
1 parent de1106b commit 4604778
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ pub fn invalid_escape_sequence(
Range::new(location, end_location),
);
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ expression: diagnostics
content: "\\"
location:
row: 2
column: 9
column: 10
end_location:
row: 2
column: 9
column: 10
parent: ~
- kind:
name: InvalidEscapeSequence
Expand All @@ -37,10 +37,10 @@ expression: diagnostics
content: "\\"
location:
row: 6
column: 0
column: 1
end_location:
row: 6
column: 0
column: 1
parent: ~
- kind:
name: InvalidEscapeSequence
Expand All @@ -57,10 +57,10 @@ expression: diagnostics
content: "\\"
location:
row: 11
column: 5
column: 6
end_location:
row: 11
column: 5
column: 6
parent: ~
- kind:
name: InvalidEscapeSequence
Expand All @@ -77,9 +77,9 @@ expression: diagnostics
content: "\\"
location:
row: 18
column: 5
column: 6
end_location:
row: 18
column: 5
column: 6
parent: ~

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ expression: diagnostics
content: "\\"
location:
row: 2
column: 9
column: 10
end_location:
row: 2
column: 9
column: 10
parent: ~
- kind:
name: InvalidEscapeSequence
Expand All @@ -37,10 +37,10 @@ expression: diagnostics
content: "\\"
location:
row: 6
column: 0
column: 1
end_location:
row: 6
column: 0
column: 1
parent: ~
- kind:
name: InvalidEscapeSequence
Expand All @@ -57,10 +57,10 @@ expression: diagnostics
content: "\\"
location:
row: 11
column: 5
column: 6
end_location:
row: 11
column: 5
column: 6
parent: ~
- kind:
name: InvalidEscapeSequence
Expand All @@ -77,9 +77,9 @@ expression: diagnostics
content: "\\"
location:
row: 18
column: 5
column: 6
end_location:
row: 18
column: 5
column: 6
parent: ~

0 comments on commit 4604778

Please sign in to comment.