Skip to content

Commit 1dad052

Browse files
authored
feat: Add static type checking (#9)
1 parent 3ca76ce commit 1dad052

File tree

6 files changed

+83
-95
lines changed

6 files changed

+83
-95
lines changed

DEPENDENCIES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
| [isort](https://pypi.org/project/isort/) | 4.3.21 | MIT License (MIT) | Makefile | dev | Python imports organizer |
99
| [pytest](https://pypi.org/project/pytest/) | 5.3.2 | MIT License (MIT license) | Makefile | dev | Python tests framework |
1010
| [twine](https://pypi.org/project/twine/) | 3.2.0 | Apache Software License | Makefile | dev | Python publishing tool |
11-
| [wheel](https://pypi.org/project/wheel/) | 0.35.1 | MIT License (MIT license) | Makefile | dev | Python packager |
11+
| [wheel](https://pypi.org/project/wheel/) | 0.35.1 | MIT License (MIT license) | Makefile | dev | Python packager |
12+
| [mypy](https://pypi.org/project/mypy/) | 0.790 | MIT License (MIT license) | Makefile | dev | Optional static type checker |

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,17 @@ format:
5151
@pipenv run isort -rc .
5252
@pipenv run black .
5353

54-
validate: validate-formating lint
54+
validate: validate-formating lint static-type-check
5555

5656
validate-formating:
5757
@pipenv run black --check --diff .
5858

5959
lint:
6060
@pipenv run flake8 --count
6161

62+
static-type-check:
63+
@pipenv run mypy .
64+
6265
clean: clean-pyc clean-build
6366

6467
clean-pyc:

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ flit = "==3.0.0"
1313
twine = "==3.2.0"
1414
wheel = "==0.35.1"
1515
bump2version = "==1.0.1"
16+
mypy = "==0.790"
1617

1718
[packages]
1819

Pipfile.lock

Lines changed: 71 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ per-file-ignores =
1515

1616
[tool:pytest]
1717
addopts = -vv
18+
19+
[mypy-setuptools.*]
20+
ignore_missing_imports = True

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
from typing import List
12
from setuptools import find_packages, setup
23

34
package_name = "checkarg"
4-
requirements = []
5+
requirements: List[str] = []
56
setup_requirements = ["pytest-runner", "wheel"]
67
test_requirements = ["flake8==3.7.8", "pytest==5.2.0", "pytest-cov==2.8.1"]
78

0 commit comments

Comments
 (0)