Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Pre-commit hooks mirroring the CI lint job (.github/workflows/ci.yml).
# ruff rev is pinned to match requirements-dev.txt so local == CI.
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff
name: ruff check
args: ["--config", "custom_components/andersen_ev/ruff.toml"]
files: ^custom_components/andersen_ev/.*\.py$
- id: ruff-format
name: ruff format
args: ["--config", "custom_components/andersen_ev/ruff.toml"]
files: ^custom_components/andersen_ev/.*\.py$
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,26 @@ data:
device_id: "YOUR_DEVICE_ID"
```

## Development

### pre-commit

This repo ships a `.pre-commit-config.yaml` that runs the same ruff lint and
format checks as CI (pinned to the same ruff version), so issues are caught
locally before you push. To enable it:

```bash
pip install pre-commit # or: pip install -r requirements-dev.txt
pre-commit install
```

The hooks then run automatically on `git commit`. To run them across the
integration source on demand:

```bash
pre-commit run --all-files
```

## Future development
Frankly depends on whether or not I sell my house (with the charger).

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pytest
pytest-asyncio
pytest-cov
mypy
pre-commit
Loading