-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This plug-in is invoked twice, when analyzing `target.py`. Since it always returns None, all it's results are ignored.
- Loading branch information
1 parent
ae8fd6c
commit 82d1ded
Showing
3 changed files
with
19 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from mypy.plugin import Plugin | ||
|
||
|
||
class CustomPlugin(Plugin): | ||
def get_type_analyze_hook(self, fullname: str) -> None: | ||
# see explanation below | ||
if fullname.startswith("sol.GetItem"): | ||
print(fullname) | ||
|
||
|
||
def plugin(version: str) -> type[CustomPlugin]: | ||
# ignore version argument if the plugin works with all mypy versions. | ||
return CustomPlugin |
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,6 +1,8 @@ | ||
from sol import GetItem | ||
|
||
reveal_type(GetItem()) | ||
# reveal_type(GetItem()) | ||
|
||
def f(): | ||
_: GetItem | ||
|
||
def f(_: GetItem) -> None: | ||
... |