-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add GitHub annotations format for --output
#17771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 many arguments for "foo". | ||
|
||
[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 type is "Overload(def (), def (x: builtins.int))". | ||
::error file=main,line=14,col=0,title=Mypy (call-overload)::No overload variant of "foo" matches argument type "str".%0A%0APossible overload variants:%0A def foo() -> None%0A def foo(x: int) -> None | ||
::error file=main,line=17,col=0,title=Mypy (call-arg)::Too many arguments for "bar". | ||
Comment on lines
+42
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks amazing! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks amazing! We would like to use it in our github actions! Will this PR be merged soon? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was preventing the choices from being displayed in the
--help
output