Skip to content

Commit 51d042a

Browse files
add linting
1 parent 43da048 commit 51d042a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,49 @@ uv run nox --session coverage
122122
```
123123

124124
All pull requests must include tests to maintain 100% coverage. Coverage configuration can be found in the `[tools.coverage.*]` sections of [`pyproject.toml`](pyproject.toml).
125+
126+
## Linting and Formatting
127+
128+
This project enforces code quality standards using [`pre-commit`](https://github.com/pre-commit/pre-commit).
129+
130+
To run all formatters and linters:
131+
132+
```bash
133+
uv run nox --session lint
134+
# or
135+
just lint
136+
```
137+
138+
The following checks are run:
139+
140+
- [ruff](https://github.com/astral-sh/ruff) - Fast Python linter and formatter
141+
- Code formatting for Python files in documentation ([blacken-docs](https://github.com/adamchainz/blacken-docs))
142+
- Django compatibility checks ([django-upgrade](https://github.com/adamchainz/django-upgrade))
143+
- TOML and YAML validation
144+
- Basic file hygiene (trailing whitespace, file endings)
145+
146+
To enable pre-commit hooks after cloning:
147+
148+
```bash
149+
uv run --with pre-commit pre-commit install
150+
```
151+
152+
Configuration for these tools can be found in:
153+
154+
- [`.pre-commit-config.yaml`](.pre-commit-config.yaml) - Pre-commit hook configuration
155+
- [`pyproject.toml`](pyproject.toml) - Ruff and other tool settings
156+
157+
## Continuous Integration
158+
159+
This project uses GitHub Actions for CI/CD. The workflows can be found in [`.github/workflows/`](.github/workflows/):
160+
161+
- [`test.yml`](.github/workflows/test.yml) - Runs on pushes to the `main` branch and on all PRs:
162+
- Tests across Python/Django version matrix
163+
- Static type checking
164+
- Coverage reporting
165+
- [`release.yml`](.github/workflows/release.yml) - Runs on GitHub release creation:
166+
- Runs the [`test.yml`](.github/workflows/test.yml) workflow
167+
- Builds package
168+
- Publishes to PyPI
169+
170+
PRs must pass all CI checks before being merged.

0 commit comments

Comments
 (0)