From 918e9fa2b13436b72f00f26d3a3c09fc07bcfcf9 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Fri, 2 Dec 2022 15:06:05 +0100 Subject: [PATCH] Replace `files` by `exclude` on mypy configuration (#1793) --- scripts/check | 2 +- setup.cfg | 27 ++++++++++----------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/scripts/check b/scripts/check index 364f1d7fd..be0c31d8f 100755 --- a/scripts/check +++ b/scripts/check @@ -11,6 +11,6 @@ set -x ./scripts/sync-version ${PREFIX}black --check --diff --target-version=py37 $SOURCE_FILES ${PREFIX}flake8 $SOURCE_FILES -${PREFIX}mypy --show-error-codes +${PREFIX}mypy --show-error-codes $SOURCE_FILES ${PREFIX}isort --check --diff --project=uvicorn $SOURCE_FILES ${PREFIX}python -m tools.cli_usage --check diff --git a/setup.cfg b/setup.cfg index f057fc3b0..71d63a395 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,23 +6,16 @@ max-line-length = 88 disallow_untyped_defs = True ignore_missing_imports = True follow_imports = silent -files = - uvicorn/, - tests/middleware/test_wsgi.py, - tests/middleware/test_proxy_headers.py, - tests/test_config.py, - tests/test_lifespan.py, - tests/test_main.py, - tests/test_default_headers.py, - tests/test_cli.py, - tests/conftest.py, - tests/importer, - tests/response.py, - tests/__init__.py, - tests/supervisors/test_multiprocess.py, - tests/test_ssl.py, - tests/utils.py - +# NOTE: If you are seing this, feel free to create a PR to cover the below files. +exclude = (?x) + ^( + |tests/protocols/test_websocket.py + |tests/middleware/test_logging.py + |tests/supervisors/test_reload.py + |tests/protocols/test_http.py + |tests/test_auto_detection.py + |tests/protocols/test_utils.py + )$ [mypy-tests.*] disallow_untyped_defs = False