You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a new branch from `main` for your contributions. Please use descriptive and concise branch names.
65
69
2. Make your desired changes or additions to the codebase.
66
70
3. Ensure that your code adheres to [PEP8](https://peps.python.org/pep-0008/) coding style guidelines.
67
-
4. Write appropriate tests for your changes, ensuring that they pass.
68
-
-`make test`
71
+
4. Write appropriate tests for your changes and verify they pass:
72
+
```bash
73
+
just test
74
+
```
69
75
5. Update the documentation and examples, if necessary.
70
-
6. Build the html documentation and verify if it works as expected. We have used Sphinx for documentation, you could build the documents as follows:
71
-
-`cd docs`
72
-
-`make clean`
73
-
-`make html`
74
-
7. Verify the html documents created under `docs/_build/html` directory. `index.html` file is the main file which contains link to all other files and doctree.
75
-
76
-
8. Commit your changes following the Conventional Commits specification (see below).
76
+
6. Build the HTML documentation and verify it works as expected:
77
+
```bash
78
+
just docs
79
+
```
80
+
Verify the output under `docs/_build/html/`. `index.html` is the entry point.
81
+
7. Run the full local check suite before pushing (lint, format, type-check, and all pre-commit hooks):
82
+
```bash
83
+
just check
84
+
```
85
+
8. Commit your changes following the Conventional Commits specification (see below):
86
+
```bash
87
+
just commit
88
+
```
77
89
9. Submit a pull request from your branch to `main` in the original repository.
78
90
10. Wait for the maintainers to review your pull request. Address any feedback or comments if required.
79
91
11. Once approved, your changes will be merged into the main codebase.
80
92
93
+
## Pre-commit Hooks
94
+
95
+
This project uses [pre-commit](https://pre-commit.com/) to enforce code quality automatically. The hooks run on two stages:
96
+
97
+
-**commit** — `ruff` format and lint checks, plus general file hygiene hooks
98
+
-**push** — `pyright` type checking (slow, so deferred to push)
99
+
100
+
`just install` registers all three hook types (`commit-msg`, `pre-commit`, `pre-push`) so everything fires at the right time automatically.
101
+
102
+
> **Important:** Run `just check` before opening a PR. It executes all hooks against every file in the repo (both commit and push stages), giving you the same signal CI will see.
103
+
104
+
```bash
105
+
# Run commit-stage hooks on all files (ruff format, ruff lint, file hygiene)
106
+
just lint
107
+
108
+
# Run ruff formatter
109
+
just format
110
+
111
+
# Run pyright type checker
112
+
just typecheck
113
+
114
+
# Run ALL hooks across ALL files (commit + push stages) — equivalent to what CI checks
115
+
just check
116
+
```
117
+
118
+
If pre-commit reports files that _would be reformatted_, run `just format`, stage the changes, and commit before pushing. Formatting-only changes should be committed separately with `style: apply ruff formatting`.
119
+
120
+
### Type checking (pyright)
121
+
122
+
Type checking with `pyright` runs automatically on `git push` via the pre-push hook (registered by `just install`). It also runs in CI as the `typecheck` job in `.github/workflows/ci.yml`.
123
+
124
+
To run it manually at any time:
125
+
126
+
```bash
127
+
just typecheck
128
+
```
129
+
130
+
Fix any reported errors before opening a PR.
131
+
81
132
## Docs Workflow
82
133
83
134
Documentation is built with [Sphinx](https://www.sphinx-doc.org/) and hosted on [Read the Docs](https://readthedocs.org/).
@@ -124,8 +175,8 @@ brew install pandoc
124
175
# or on Ubuntu
125
176
sudo apt-get install pandoc
126
177
127
-
# Install doc dependencies
128
-
pip install -r docs/requirements_docs.txt
178
+
# Install doc dependencies (if not already done)
179
+
poetry install --with docs
129
180
130
181
# Build HTML docs (warnings treated as errors)
131
182
sphinx-build -b html docs/ docs/_build/html -W --keep-going
0 commit comments