File tree Expand file tree Collapse file tree 4 files changed +64
-3
lines changed Expand file tree Collapse file tree 4 files changed +64
-3
lines changed Original file line number Diff line number Diff line change 77 paths :
88 - ' **.py' # Run if pushed commits include a change to a Python (.py) file.
99 - ' .github/workflows/lint.yaml' # Run if pushed commits include a change to a github actions workflow file.
10- - ' . pyproject.toml' # Run if project configuration file changes.
10+ - ' pyproject.toml' # Run if project configuration file changes.
1111 pull_request :
1212 branches :
1313 - " main"
1414 paths :
1515 - ' **.py' # Run if pushed commits include a change to a Python (.py) file.
1616 - ' .github/workflows/lint.yaml' # Run if pushed commits include a change to a github actions workflow file.
17- - ' . pyproject.toml' # Run if project configuration file changes.
17+ - ' pyproject.toml' # Run if project configuration file changes.
1818 workflow_dispatch :
1919
2020jobs :
3434 uses : astral-sh/ruff-action@v3
3535 with :
3636 args : format --check --diff
37+
38+ mypy :
39+ runs-on : ubuntu-latest
40+
41+ steps :
42+ - name : Checkout code
43+ uses : actions/checkout@v5
44+
45+ - name : Install uv
46+ uses : astral-sh/setup-uv@v4
47+ with :
48+ enable-cache : true
49+
50+ - name : Set up Python
51+ run : uv python install
52+
53+ - name : Install dependencies
54+ run : uv sync
55+
56+ - name : Run mypy
57+ run : uv run mypy custom_components/battery_notes/ --check-untyped-defs
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ Changelog = "https://github.com/andrew-codechimp/HA-Battery-Notes/releases"
2929dev = [
3030 " colorlog" ,
3131 " homeassistant==2025.9.0" ,
32+ " mypy" ,
3233 " ruff" ,
3334]
3435
@@ -156,7 +157,7 @@ follow_imports = "normal"
156157ignore_missing_imports = true
157158
158159# be strict
159- # check_untyped_defs = true
160+ check_untyped_defs = true
160161# disallow_any_generics = true
161162# disallow_incomplete_defs = true
162163# disallow_subclassing_any = true
Original file line number Diff line number Diff line change @@ -4,4 +4,10 @@ set -euo pipefail
44# Move to project root
55cd " $( dirname " $0 " ) /.."
66
7+ echo " Running ruff check..."
78uv run ruff check . --fix
9+
10+ echo " Running mypy type checking..."
11+ uv run mypy custom_components/battery_notes/ --check-untyped-defs
12+
13+ echo " Lint completed successfully!"
You can’t perform that action at this time.
0 commit comments