Skip to content

Commit cf8faf2

Browse files
docs: add pre-commit setup to bootstrap and deduplicate contributing guides (#1946)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0acf5d6 commit cf8faf2

2 files changed

Lines changed: 19 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ Follow these instructions in addition to any higher-level system or tool rules.
2222
- **Preserve public behavior and CLI UX** — no breaking changes to APIs, CLI flags, or exit codes unless explicitly requested.
2323
- **Update or add tests/docs** when you change user-facing behavior.
2424
- **Commit messages** must follow [Conventional Commits](https://www.conventionalcommits.org/) (enforced by commitizen itself).
25+
- **Pull requests** must follow the [Pull Request Guidelines](docs/contributing/pull_request.md) and the template in `.github/pull_request_template.md`.
2526

2627
## Setup and Validation
2728

29+
> Full contributor guidelines (prerequisites, workflow, PR process): [`docs/contributing/contributing.md`](docs/contributing/contributing.md).
30+
2831
### Bootstrap
2932

3033
```bash
3134
uv sync --frozen --group base --group test --group linters
35+
uv run poe setup-pre-commit # install git hooks (uses prek, a pre-commit runner)
3236
```
3337

3438
### Local commands
@@ -44,7 +48,7 @@ Always run at least `uv run ruff check --fix . && uv run ruff format .` before p
4448
### CI pipeline
4549

4650
- CI runs `poe ci` on a matrix of Python 3.10–3.14 × ubuntu/macos/windows.
47-
- Pre-commit hooks are defined in `.pre-commit-config.yaml` and run via `prek`.
51+
- Pre-commit hooks are defined in `.pre-commit-config.yaml` and run via [`prek`](https://github.com/j178/prek) (a `pre-commit` compatible runner).
4852
- The matrix is **fail-fast**: inspect the earliest failing job that completed; others are cancelled.
4953

5054
### Common CI failure patterns

docs/contributing/contributing_tldr.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,29 @@
22

33
Feel free to send a PR to update this file if you find anything useful. 🙇
44

5-
## Environment
5+
For prerequisites and initial setup, see [Contributing to Commitizen](contributing.md#prerequisites-setup).
66

7-
- Python `>=3.10`
8-
- [uv](https://docs.astral.sh/uv/getting-started/installation/) `>=0.9.0`
7+
## Command Cheat Sheet
98

10-
## Useful commands
11-
12-
Please check the [pyproject.toml](https://github.com/commitizen-tools/commitizen/blob/master/pyproject.toml) for a comprehensive list of commands.
13-
14-
### Code Changes
9+
See [pyproject.toml](https://github.com/commitizen-tools/commitizen/blob/master/pyproject.toml) for the full list of poe tasks.
1510

1611
```bash
17-
# Ensure you have the correct dependencies
18-
uv sync --dev --frozen
19-
20-
# Make ruff happy
12+
# Format code (ruff check --fix + ruff format)
2113
uv run poe format
2214

23-
# Check if ruff and mypy are happy
15+
# Lint (ruff check + mypy)
2416
uv run poe lint
2517

26-
# Check if mypy is happy in python 3.10
27-
mypy --python-version 3.10
18+
# Check mypy against a specific Python version
19+
uv run mypy --python-version 3.10
2820

29-
# Run tests in parallel.
30-
pytest -n auto # This may take a while.
31-
pytest -n auto <test_suite>
32-
```
21+
# Run tests in parallel (may take a while)
22+
uv run pytest -n auto
23+
uv run pytest -n auto <test_suite>
3324

34-
### Documentation Changes
35-
36-
```bash
37-
# Build the documentation locally and check for broken links
25+
# Build and preview docs locally
3826
uv run poe doc
27+
28+
# Run everything (format + lint + check-commit + coverage)
29+
uv run poe all
3930
```

0 commit comments

Comments
 (0)