-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: another line terminator bug fix
I believe this case is different from the last in that it happens when the end of a *multi-line* annotation occurs after a line terminator. Previously, the diagnostic would render on the next line, which is definitely a bit weird. This new update renders it at the end of the line the annotation ends on. In some cases, the annotation was previously rendered to point at source lines below where the error occurred, which is probably pretty confusing.
- Loading branch information
1 parent
5caef89
commit 79e71cb
Showing
9 changed files
with
70 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
...isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_class_after.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
..._linter__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 23 additions & 24 deletions
47
...pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,41 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pylint/mod.rs | ||
snapshot_kind: text | ||
--- | ||
bidirectional_unicode.py:2:1: PLE2502 Contains control characters that can permit obfuscated code | ||
| | ||
1 | # E2502 | ||
2 | / print("שלום") | ||
3 | | | ||
| |_^ PLE2502 | ||
4 | # E2502 | ||
5 | example = "x" * 100 # "x" is assigned | ||
1 | # E2502 | ||
2 | print("שלום") | ||
| ^^^^^^^^^^^^^ PLE2502 | ||
3 | | ||
4 | # E2502 | ||
5 | example = "x" * 100 # "x" is assigned | ||
| | ||
|
||
bidirectional_unicode.py:5:1: PLE2502 Contains control characters that can permit obfuscated code | ||
| | ||
4 | # E2502 | ||
5 | / example = "x" * 100 # "x" is assigned | ||
6 | | | ||
| |_^ PLE2502 | ||
7 | # E2502 | ||
8 | if access_level != "none": # Check if admin ' and access_level != 'user | ||
4 | # E2502 | ||
5 | example = "x" * 100 # "x" is assigned | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE2502 | ||
6 | | ||
7 | # E2502 | ||
8 | if access_level != "none": # Check if admin ' and access_level != 'user | ||
| | ||
|
||
bidirectional_unicode.py:8:1: PLE2502 Contains control characters that can permit obfuscated code | ||
| | ||
7 | # E2502 | ||
8 | / if access_level != "none": # Check if admin ' and access_level != 'user | ||
9 | | print("You are an admin.") | ||
| |_^ PLE2502 | ||
7 | # E2502 | ||
8 | if access_level != "none": # Check if admin ' and access_level != 'user | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE2502 | ||
9 | print("You are an admin.") | ||
| | ||
|
||
bidirectional_unicode.py:14:1: PLE2502 Contains control characters that can permit obfuscated code | ||
| | ||
12 | # E2502 | ||
13 | def subtract_funds(account: str, amount: int): | ||
14 | / """Subtract funds from bank account then """ | ||
15 | | return | ||
| |_^ PLE2502 | ||
16 | bank[account] -= amount | ||
17 | return | ||
12 | # E2502 | ||
13 | def subtract_funds(account: str, amount: int): | ||
14 | """Subtract funds from bank account then """ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE2502 | ||
15 | return | ||
16 | bank[account] -= amount | ||
17 | return | ||
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters