From b55464e766eaf14a373f9097e9f195172a791e6f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 19 Jun 2024 17:31:52 +0100 Subject: [PATCH] Improve MyPy configuration Some improvments flagged by Repo-Review: https://learn.scientific-python.org/development/guides/repo-review/ 1. Remove now-default show_error_codes. 2. Enable some optional error codes with extra checks. --- pyproject.toml | 6 +++++- tests/test_django_watchfiles.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b43ea7a..226b3b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,9 +76,13 @@ source = [ show_missing = true [tool.mypy] +enable_error_code = [ + "ignore-without-code", + "redundant-expr", + "truthy-bool", +] mypy_path = "src/" namespace_packages = false -show_error_codes = true strict = true warn_unreachable = true diff --git a/tests/test_django_watchfiles.py b/tests/test_django_watchfiles.py index e2a13d7..1c96d72 100644 --- a/tests/test_django_watchfiles.py +++ b/tests/test_django_watchfiles.py @@ -6,4 +6,4 @@ def test_import(): import django_watchfiles - assert django_watchfiles + assert django_watchfiles # type: ignore [truthy-bool]