diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92d83d17..0f7bcfa1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,3 +8,9 @@ repos: rev: 5.10.1 hooks: - id: isort + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.910 + hooks: + - id: mypy + pass_filenames: false diff --git a/pyproject.toml b/pyproject.toml index 4a9c8162..305bc1b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,46 @@ skip_glob = ["*/setup.py"] filter_files = true known_first_party = "cleo" +[tool.mypy] +strict = true +files = "cleo, tests" + +# The following whitelist is used to allow for incremental adoption +# of Mypy. Modules should be removed from this whitelist as and when +# their respective type errors have been addressed. No new modules +# should be added to this whitelist. + +[[tool.mypy.overrides]] +module = [ + "cleo._utils", + "cleo.application", + "cleo.descriptors.*", + "cleo.color", + "cleo.commands.*", + "cleo.events.*", + "cleo.formatters.*", + "cleo.io.*", + "cleo.loaders.*", + "cleo.parser", + "cleo.terminal", + "cleo.testers.*", + "cleo.ui.*", + "tests.commands.*", + "tests.conftest", + "tests.events.*", + "tests.fixtures.*", + "tests.formatters.*", + "tests.io.*", + "tests.loaders.*", + "tests.test_application", + "tests.test_color", + "tests.test_helpers", + "tests.test_parser", + "tests.testers.*", + "tests.ui.*", +] +ignore_errors = true + [build-system] requires = ["poetry-core~=1.0"]