Skip to content

Commit 8f04de1

Browse files
authored
Add mypy CI job (#70)
1 parent 49c8cf3 commit 8f04de1

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
name: Ruff
2-
on: [ push, pull_request ]
1+
name: Lint
2+
on:
3+
push:
4+
pull_request:
5+
permissions:
6+
contents: read
7+
38
jobs:
49
ruff:
510
runs-on: ubuntu-latest
611
steps:
712
- uses: actions/checkout@v4
813
- uses: chartboost/ruff-action@v1
14+
mypy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.x"
23+
- uses: pypa/hatch@install
24+
- name: Run mypy
25+
run: hatch run types:check

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@ dependencies = [
6161
python = ["3.9", "3.10", "3.11", "3.12"]
6262

6363
[tool.hatch.envs.types]
64+
template = "hatch-test"
6465
extra-dependencies = [
6566
"mypy~=1.0",
6667
]
6768

6869
[tool.hatch.envs.types.scripts]
69-
check = "mypy --install-types --non-interactive --explicit-package-bases {args:src/shelloracle tests}"
70+
check = [
71+
"mypy {args:src/shelloracle}",
72+
"mypy --explicit-package-bases tests"
73+
]
7074

7175
[tool.pytest.ini_options]
7276
pythonpath = "src"
@@ -88,4 +92,4 @@ exclude_lines = [
8892
]
8993

9094
[tool.ruff.lint.extend-per-file-ignores]
91-
"tests/*" = ["INP001", "ARG"]
95+
"tests/*" = ["INP001", "ARG"]

src/shelloracle/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def user_configure_settings(provider: type[Provider]) -> dict[str, Any]:
134134
for name, setting in get_settings(provider):
135135
user_input = prompt(f"{name}: ", default=str(setting.default))
136136
type_ = type(setting.default) if setting.default else str
137-
value = type_(user_input)
137+
value = type_(user_input) # type: ignore[operator]
138138
settings[name] = value
139139
return settings
140140

0 commit comments

Comments
 (0)