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
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ repos:
hooks:
- id: markdownlint
args: [--config, .markdownlint.json]

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [feat, fix, chore, docs, refactor, ci, test, style, perf, revert]
28 changes: 28 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ This project provides two methods to connect Tuya BLE plant sensors (SGS01) to H
- YAML: 2-space indentation
- Keep scripts compatible with Raspberry Pi Zero W (ARM, limited resources)

## Commit Message Convention

This repository enforces [Conventional Commits](https://www.conventionalcommits.org/) via pre-commit.
All commit messages must follow the format:

```
type(scope): subject
```

Allowed types: `feat`, `fix`, `chore`, `docs`, `refactor`, `ci`, `test`, `style`, `perf`, `revert`

Examples:

```
feat: add MQTT reconnect logic
fix(ble_poller): handle timeout on sensor scan
chore: update pre-commit hook versions
docs: add architecture diagram to README
refactor(tuya_ble): simplify packet parsing
ci: add GitHub Actions lint workflow
```

The `scope` is optional. To activate the commit-msg hook after cloning, run:

```bash
make install-hooks
```

## Testing

```bash
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help lint lint-python lint-yaml lint-markdown format install test clean
.PHONY: help lint lint-python lint-yaml lint-markdown format install install-hooks test clean

help:
@echo "Available targets:"
Expand All @@ -8,6 +8,7 @@ help:
@echo " lint-markdown - Run markdownlint on Markdown files"
@echo " format - Auto-format Python files with Ruff"
@echo " install - Install development dependencies"
@echo " install-hooks - Install pre-commit hooks including commit-msg stage"
@echo " test - Run tests"
@echo " clean - Remove build artifacts"

Expand All @@ -30,6 +31,9 @@ install:
pip install ruff yamllint markdownlint-cli2 pre-commit
pre-commit install

install-hooks:
pre-commit install --hook-type commit-msg

test:
cd pi-fallback && python -m pytest -v

Expand Down