Skip to content

Commit 328034d

Browse files
docs: add pre-commit setup to bootstrap and deduplicate contributing guides
- Add missing setup-pre-commit step to AGENTS.md bootstrap - Clarify what prek is with a link to its repository - Add cross-references between AGENTS.md and contributing.md - Refactor contributing_tldr.md into a pure command cheat sheet, removing duplicated prerequisites/setup already in contributing.md - Fix bare mypy/pytest commands to use uv run prefix - Fix anchor link to prerequisites section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0acf5d6 commit 328034d

2 files changed

Lines changed: 18 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ Follow these instructions in addition to any higher-level system or tool rules.
2525

2626
## Setup and Validation
2727

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

3032
```bash
3133
uv sync --frozen --group base --group test --group linters
34+
uv run poe setup-pre-commit # install git hooks (uses prek, a pre-commit runner)
3235
```
3336

3437
### Local commands
@@ -44,7 +47,7 @@ Always run at least `uv run ruff check --fix . && uv run ruff format .` before p
4447
### CI pipeline
4548

4649
- 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`.
50+
- Pre-commit hooks are defined in `.pre-commit-config.yaml` and run via [`prek`](https://github.com/j178/prek) (a `pre-commit` compatible runner).
4851
- The matrix is **fail-fast**: inspect the earliest failing job that completed; others are cancelled.
4952

5053
### 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)