-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub annotations format for
--output
- Loading branch information
1 parent
26a77f9
commit e03e7f1
Showing
5 changed files
with
110 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
-- Test cases for `--output=json`. | ||
-- These cannot be run by the usual unit test runner because of the backslashes | ||
-- in the output, which get normalized to forward slashes by the test suite on | ||
-- Windows. | ||
|
||
[case testOutputGitHubNoIssues] | ||
# flags: --output=github | ||
def foo() -> None: | ||
pass | ||
|
||
foo() | ||
[out] | ||
|
||
[case testOutputGitHubSimple] | ||
# flags: --output=github | ||
def foo() -> None: | ||
pass | ||
|
||
foo(1) | ||
[out] | ||
::error file=main,line=5,col=0,title=Mypy (call-arg)::Too%20many%20arguments%20for%20%22foo%22 | ||
|
||
[case testOutputGitHubWithHint] | ||
# flags: --output=github | ||
from typing import Optional, overload | ||
|
||
@overload | ||
def foo() -> None: ... | ||
@overload | ||
def foo(x: int) -> None: ... | ||
|
||
def foo(x: Optional[int] = None) -> None: | ||
... | ||
|
||
reveal_type(foo) | ||
|
||
foo('42') | ||
|
||
def bar() -> None: ... | ||
bar('42') | ||
[out] | ||
::notice file=main,line=12,col=12,title=Mypy (misc)::Revealed%20type%20is%20%22Overload%28def%20%28%29%2C%20def%20%28x%3A%20builtins.int%29%29%22 | ||
::error file=main,line=14,col=0,title=Mypy (call-overload)::No%20overload%20variant%20of%20%22foo%22%20matches%20argument%20type%20%22str%22%0A%0APossible%20overload%20variants%3A%0A%0A%20%20%20%20def%20foo%28%29%20-%3E%20None%0A%0A%20%20%20%20def%20foo%28x%3A%20int%29%20-%3E%20None | ||
::error file=main,line=17,col=0,title=Mypy (call-arg)::Too%20many%20arguments%20for%20%22bar%22 |