Skip to content

Commit 4b49f81

Browse files
refactor: type check with mypy
1 parent 1ff0855 commit 4b49f81

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
- name: Install dependencies
2121
run: pip install -e .[lint]
2222

23+
- name: Type check
24+
run: mypy src
25+
2326
- name: Run Black
2427
run: black --check .
2528

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ repos:
1515
- id: requirements-txt-fixer
1616
- id: trailing-whitespace
1717

18+
- repo: https://github.com/pre-commit/mirrors-mypy
19+
rev: v1.19.1
20+
hooks:
21+
- id: mypy
22+
1823
- repo: https://github.com/psf/black
1924
rev: 25.1.0
2025
hooks:

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ docs = [
3333
lint = [
3434
"black==25.12.0",
3535
"isort==7.0.0",
36+
"mypy==1.19.1",
3637
"pre-commit==4.5.1",
3738
"ruff==0.14.13",
3839
]
@@ -48,7 +49,13 @@ Issues = "https://github.com/remarkablemark/python-cli-template/issues"
4849
[tool.black]
4950
fast = true
5051

52+
[tool.mypy]
53+
strict = true
54+
ignore_missing_imports = true
55+
5156
[tool.coverage.run]
5257
omit = [
58+
"*/tests/*",
59+
"/opt/*",
5360
"/tmp/*",
5461
]

src/python_cli_template/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from python_cli_template import __version__, hello
44

55

6-
def main(argv: list[str] = None) -> None:
6+
def main(argv: list[str] = []) -> None:
77
parser = ArgumentParser(description="Python CLI Template")
88

99
parser.add_argument(

0 commit comments

Comments
 (0)