From 5eecb189ac36a65c483ff32e797e4a09425c32d2 Mon Sep 17 00:00:00 2001 From: Deimos Date: Thu, 26 Sep 2019 12:10:49 -0600 Subject: [PATCH] Update mypy to 0.730 There are some new capabilities in mypy 0.730, including nicer output formatting, which this enables. I'd also like to be able to use the specific error-code ignoring instead of the current all-encompassing "type: ignore" comments, but there's currently an issue with that: https://github.com/python/mypy/issues/7562 --- git_hooks/pre-commit | 2 +- git_hooks/pre-push | 2 +- tildes/mypy.ini | 3 +++ tildes/requirements.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit index 74fded4..c240ebb 100755 --- a/git_hooks/pre-commit +++ b/git_hooks/pre-commit @@ -3,7 +3,7 @@ # Pre-commit hook script that ensures mypy checks and tests pass vagrant ssh -c ". activate \ - && echo 'Checking mypy type annotations...' && mypy . \ + && echo 'Checking mypy type annotations...' && mypy --no-error-summary . \ && echo 'Checking if Black would reformat any code...' && black --check . \ && echo -n 'Running tests: ' && pytest -q \ && echo 'Checking SCSS style...' && npm run --silent lint:scss \ diff --git a/git_hooks/pre-push b/git_hooks/pre-push index 261bcfc..03f7a8c 100755 --- a/git_hooks/pre-push +++ b/git_hooks/pre-push @@ -3,7 +3,7 @@ # Pre-push hook script that ensures mypy checks, style checks, and tests pass vagrant ssh -c ". activate \ - && echo 'Checking mypy type annotations...' && mypy . \ + && echo 'Checking mypy type annotations...' && mypy --no-error-summary . \ && echo 'Checking if Black would reformat any code...' && black --check . \ && echo -n 'Running tests: ' && pytest -q \ && echo 'Checking SCSS style...' && npm run --silent lint:scss \ diff --git a/tildes/mypy.ini b/tildes/mypy.ini index 0da2c5f..3d54ee7 100644 --- a/tildes/mypy.ini +++ b/tildes/mypy.ini @@ -3,6 +3,9 @@ mypy_path = /opt/tildes/stubs/ disallow_untyped_defs = true ignore_missing_imports = true no_implicit_optional = true +pretty = true +show_error_codes = true +show_error_context = true warn_redundant_casts = true warn_unused_ignores = true diff --git a/tildes/requirements.txt b/tildes/requirements.txt index 15c2cb6..0b27bfd 100644 --- a/tildes/requirements.txt +++ b/tildes/requirements.txt @@ -34,7 +34,7 @@ MarkupSafe==1.1.1 marshmallow==2.20.5 mccabe==0.6.1 more-itertools==7.2.0 -mypy==0.720 +mypy==0.730 mypy-extensions==0.4.1 packaging==19.2 parso==0.5.1