Skip to content

Commit cfb4fb1

Browse files
committed
Add CONTRIBUTING.md
1 parent 3f25ccd commit cfb4fb1

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing
2+
3+
Thanks for considering a contribution!
4+
5+
## Setup
6+
7+
```sh
8+
python3 -m venv .venv
9+
.venv/bin/pip install -e .
10+
.venv/bin/pip install pre-commit
11+
.venv/bin/pre-commit install
12+
```
13+
14+
## Running tests
15+
16+
```sh
17+
.venv/bin/python -m unittest discover -vs tests
18+
```
19+
20+
Tests also run in CI on Python 3.10–3.14. New hooks should ship with tests
21+
in `tests/`.
22+
23+
## Linting and formatting
24+
25+
`pre-commit` runs `black`, `isort`, `flake8`, and `pyupgrade`. Either let
26+
the installed hook handle it on commit, or run it manually:
27+
28+
```sh
29+
.venv/bin/pre-commit run --all-files
30+
```
31+
32+
pre-commit.ci also runs these hooks on every PR.
33+
34+
## Adding a new hook
35+
36+
A new hook needs:
37+
38+
- An entry in `.pre-commit-hooks.yaml`
39+
- An entry point in `setup.py`
40+
- A usage example in `README.md`
41+
- Tests in `tests/`

0 commit comments

Comments
 (0)