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

fix: allow warn_unreachable to be set to False explicitly #353

Merged
merged 1 commit into from
Dec 22, 2023
Merged
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
10 changes: 5 additions & 5 deletions src/sp_repo_review/checks/mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def check(pyproject: dict[str, Any]) -> bool:
"""

match pyproject:
case {"tool": {"mypy": {"show_error_codes": object()}}}:
case {"tool": {"mypy": {"show_error_codes": bool()}}}:
return False
case _:
return True
Expand All @@ -83,10 +83,10 @@ class MY103(MyPy):
@staticmethod
def check(pyproject: dict[str, Any]) -> bool:
"""
Must have `warn_unreachable = true` to pass this check. There are
Must have `warn_unreachable` (true/false) to pass this check. There are
occasionally false positives (often due to platform or Python version
static checks), so it's okay to ignore this check. But try it first - it
can catch real bugs too.
static checks), so it's okay to set it to false if you need to. But try
it first - it can catch real bugs too.

```toml
[tool.mypy]
Expand All @@ -95,7 +95,7 @@ def check(pyproject: dict[str, Any]) -> bool:
"""

match pyproject:
case {"tool": {"mypy": {"warn_unreachable": True}}}:
case {"tool": {"mypy": {"warn_unreachable": bool()}}}:
return True
case _:
return False
Expand Down