-
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.
Support
pyright: ignore
comments (#3941)
- Loading branch information
1 parent
eb0dd74
commit 10da3bc
Showing
8 changed files
with
150 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
x = 1 # type: ignore | ||
x = 1 # type ignore | ||
x = 1 # type:ignore | ||
x = 1 # type: ignore[attr-defined] # type: ignore | ||
|
||
x = 1 | ||
x = 1 # type ignore | ||
x = 1 # type ignore # noqa | ||
x = 1 # type: ignore[attr-defined] | ||
x = 1 # type: ignore[attr-defined, name-defined] | ||
x = 1 # type: ignore[attr-defined] # type: ignore[type-mismatch] | ||
x = 1 # type: ignore[type-mismatch] # noqa | ||
x = 1 # type: ignore [attr-defined] | ||
x = 1 # type: ignore [attr-defined, name-defined] | ||
x = 1 # type: ignore [type-mismatch] # noqa | ||
x = 1 # type: Union[int, str] | ||
x = 1 # type: ignoreme |
16 changes: 16 additions & 0 deletions
16
crates/ruff/resources/test/fixtures/pygrep-hooks/PGH003_1.py
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
x = 1 # pyright: ignore | ||
x = 1 # pyright:ignore | ||
x = 1 # pyright: ignore[attr-defined] # pyright: ignore | ||
|
||
x = 1 | ||
x = 1 # pyright ignore | ||
x = 1 # pyright ignore # noqa | ||
x = 1 # pyright: ignore[attr-defined] | ||
x = 1 # pyright: ignore[attr-defined, name-defined] | ||
x = 1 # pyright: ignore[attr-defined] # pyright: ignore[type-mismatch] | ||
x = 1 # pyright: ignore[type-mismatch] # noqa | ||
x = 1 # pyright: ignore [attr-defined] | ||
x = 1 # pyright: ignore [attr-defined, name-defined] | ||
x = 1 # pyright: ignore [type-mismatch] # noqa | ||
x = 1 # pyright: Union[int, str] | ||
x = 1 # pyright: ignoreme |
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
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
30 changes: 30 additions & 0 deletions
30
...rc/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_1.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: crates/ruff/src/rules/pygrep_hooks/mod.rs | ||
--- | ||
PGH003_1.py:1:8: PGH003 Use specific rule codes when ignoring type issues | ||
| | ||
1 | x = 1 # pyright: ignore | ||
| ^^^^^^^^^^^^^^^^^ PGH003 | ||
2 | x = 1 # pyright:ignore | ||
3 | x = 1 # pyright: ignore[attr-defined] # pyright: ignore | ||
| | ||
|
||
PGH003_1.py:2:8: PGH003 Use specific rule codes when ignoring type issues | ||
| | ||
2 | x = 1 # pyright: ignore | ||
3 | x = 1 # pyright:ignore | ||
| ^^^^^^^^^^^^^^^^ PGH003 | ||
4 | x = 1 # pyright: ignore[attr-defined] # pyright: ignore | ||
| | ||
|
||
PGH003_1.py:3:41: PGH003 Use specific rule codes when ignoring type issues | ||
| | ||
3 | x = 1 # pyright: ignore | ||
4 | x = 1 # pyright:ignore | ||
5 | x = 1 # pyright: ignore[attr-defined] # pyright: ignore | ||
| ^^^^^^^^^^^^^^^^^ PGH003 | ||
6 | | ||
7 | x = 1 | ||
| | ||
|
||
|