-
-
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
9d56820
commit 0b4c23a
Showing
3 changed files
with
105 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
-- 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::(`call-arg`) Too many arguments for "foo" | ||
|
||
[case testOutputGitHubWithHint] | ||
# flags: --output=json | ||
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::(`misc`) Revealed type is "Overload(def (), def (x: builtins.int))" | ||
::error file=main,line=14,col=0::(`call-overload`) No overload variant of "foo" matches argument type "str" | ||
::error file=main,line=17,col=0::(`call-arg`) Too many arguments for "bar" | ||
|