Skip to content

Commit 6c596bc

Browse files
igalicgronke
authored andcommitted
stricter checking of types
This patchset addresses #39. we've now added the entire (default) config of flake8-mypy. The following options deviate from their default (which gets us a step closer to mypy --strct) - ignore_missing_imports=False - follow_imports=True - cache_dir=.mypy_cache - disallow_untyped_calls=True - warn_return_any=True We've also toggled these two: - warn_redundant_casts=True - warn_unused_ignores=True Finally, we check for - check_untyped_defs=True For the full --strict set, we'd also need: - disallow_untyped_defs=True But that, we'll need better typedefs.
1 parent 65de312 commit 6c596bc

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

setup.cfg

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,42 @@ description-file = README.md
44
[mypy]
55
python_version = 3.6
66
# override flake8-mypy defaults, since we provide (missing) types
7+
platform='freebsd'
8+
9+
# flake8-mypy expects the two following for sensible formatting
10+
show_column_numbers=True
11+
show_error_context=False
12+
713
ignore_missing_imports=False
8-
disallow_untyped_calls=True
914
follow_imports=True
1015
cache_dir=.mypy_cache
1116

17+
# disallow untyped calls since we provide our own typedefs
18+
disallow_untyped_calls=True
19+
20+
# don't allow just Any thing.
21+
warn_return_any=True
22+
23+
# treat Optional per PEP 484
24+
strict_optional=True
25+
26+
# ensure all execution paths are returning
27+
warn_no_return=True
28+
29+
# lint-style cleanliness for typing needs to be disabled; returns more errors
30+
# than the full run.
31+
warn_redundant_casts=True
32+
warn_unused_ignores=True
33+
34+
# The following are off by default. Flip them on if you feel
35+
# adventurous.
36+
37+
# this is okay
38+
check_untyped_defs=True
39+
# this will need better typedefs
40+
disallow_untyped_defs=False
41+
42+
1243
[tool:pytest]
1344
addopts = -v -x -rs --ignore=setup.py --pep8 --cov-report term-missing --cov=iocage/lib iocage/lib iocage/tests
1445
pep8maxlinelength = 80

0 commit comments

Comments
 (0)