Skip to content
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

test mypy ignore note refactor retry (true) #30

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: reviewdog
on: [push, pull_request]
jobs:
mypy:
name: runner / mypy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Select reporter
uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: "github-pr-review"
if_false: "github-check"
- name: Lint mypy
uses: tsuyoshicho/action-mypy@refactor/ignorenote
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: ${{ steps.reporter.outputs.value }}
level: warning
fail_on_error: true
workdir: "./src"
ignore_note: true
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
warn_no_return = False
33 changes: 33 additions & 0 deletions src/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from typing import Literal, overload
import pytest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Cannot find implementation or library stub for module named "pytest" [import]



class Superclass:
@property
def name(self) -> str:
return 'xyz'

class Subclass(Superclass):
@property
def name(self) -> int:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Signature of "name" incompatible with supertype "Superclass" [override]

return 123


def test_approx():
assert 0 == pytest.approx(0)


class Someclass:
@overload
def method(self, arg1: Literal['html']) -> None: ...
@overload
def method(self, arg1: Literal['xml']) -> None: ...
@overload
def method(self, arg1: Literal['text']) -> None: ...
@overload
def method(self, arg1: str) -> None: ...
def method(self, arg1):
pass

a = Someclass()
a.method(123)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
No overload variant of "method" of "Someclass" matches argument type "int" [call-overload]