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
3 changes: 2 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ludeeus/ttlock_ble",
"name": "roquerodrigo/ha-ttlock-ble",
"image": "mcr.microsoft.com/devcontainers/base:debian",
"postCreateCommand": "scripts/setup",
"forwardPorts": [
Expand Down Expand Up @@ -40,6 +40,7 @@
"ghcr.io/devcontainers/features/python:1": {
"version": "3.14"
},
"ghcr.io/va-h/devcontainers-features/uv:1": {},
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
"packages": "ffmpeg,libturbojpeg0,libpcap-dev"
}
Expand Down
26 changes: 21 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# Run with: pre-commit install (after scripts/setup)
# CI mirrors these checks via .github/workflows/lint.yml
# CI mirrors these checks via .github/workflows/ci.yml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
- repo: local
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
name: ruff format
entry: uv run ruff format
language: system
types_or: [python, pyi]
require_serial: true

- id: ruff-check
name: ruff check
entry: uv run ruff check --fix
language: system
types_or: [python, pyi]
require_serial: true

- id: mypy
name: mypy
entry: uv run mypy custom_components/ttlock_ble
language: system
pass_filenames: false
types: [python]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand Down
8 changes: 1 addition & 7 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@ set -e

cd "$(dirname "$0")/.."

# Auto-use ./.venv if present so callers don't need to `source activate`.
if [ -d "${PWD}/.venv" ]; then
export PATH="${PWD}/.venv/bin:${PATH}"
export VIRTUAL_ENV="${PWD}/.venv"
fi

python3 -m pip install --requirement requirements.txt
uv sync --group dev --group lint
Loading