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
Copy file name to clipboardExpand all lines: docs/contributing.md
+32-8Lines changed: 32 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,26 +109,50 @@ All tests are automatically run via GitHub Actions for every pull request and mu
109
109
110
110
> **Note:** Previous versions of Zarr-Python made extensive use of doctests. These tests were not maintained during the 3.0 refactor but may be brought back in the future. See issue #2614 for more details.
111
111
112
-
### Code standards - using pre-commit
112
+
### Code standards - using prek
113
113
114
114
All code must conform to the PEP8 standard. Regarding line length, lines up to 100 characters are allowed, although please try to keep under 90 wherever possible.
115
115
116
-
`Zarr` uses a set of `pre-commit` hooks and the `pre-commit` bot to format, type-check, and prettify the codebase. `pre-commit` can be installed locally by running:
116
+
`Zarr` uses a set of git hooks managed by [`prek`](https://github.com/j178/prek), a fast, Rust-based pre-commit hook manager that is fully compatible with `.pre-commit-config.yaml` files. `prek` can be installed locally by running:
117
117
118
118
```bash
119
-
python -m pip install pre-commit
119
+
uv tool install prek
120
+
```
121
+
122
+
or:
123
+
124
+
```bash
125
+
pip install prek
120
126
```
121
127
122
128
The hooks can be installed locally by running:
123
129
124
130
```bash
125
-
pre-commit install
131
+
prek install
132
+
```
133
+
134
+
This would run the checks every time a commit is created locally. The checks will by default only run on the files modified by a commit, but the checks can be triggered for all the files by running:
135
+
136
+
```bash
137
+
prek run --all-files
138
+
```
139
+
140
+
You can also run hooks only for files in a specific directory:
141
+
142
+
```bash
143
+
prek run --directory src/zarr
144
+
```
145
+
146
+
Or run hooks for files changed in the last commit:
147
+
148
+
```bash
149
+
prek run --last-commit
126
150
```
127
151
128
-
This would run the checks every time a commit is created locally. These checks will also run on every commit pushed to an open PR, resulting in some automatic styling fixes by the `pre-commit` bot. The checks will by default only run on the files modified by a commit, but the checks can be triggered for all the files by running:
152
+
To list all available hooks:
129
153
130
154
```bash
131
-
pre-commit run --all-files
155
+
prek list
132
156
```
133
157
134
158
If you would like to skip the failing checks and push the code for further discussion, use the `--no-verify` option with `git commit`.
@@ -143,7 +167,7 @@ Zarr strives to maintain 100% test coverage under the latest Python stable relea
143
167
hatch env run --env test.py3.12-2.2-optional run-coverage
144
168
```
145
169
146
-
will automatically run the test suite with coverage and produce a XML coverage report. This should be 100% before code can be accepted into the main code base.
170
+
will automatically run the test suite with coverage and produce an XML coverage report. This should be 100% before code can be accepted into the main code base.
147
171
148
172
You can also generate an HTML coverage report by running:
149
173
@@ -273,4 +297,4 @@ performance benchmarks as part of our test suite. The benchmarks can be are foun
273
297
By default pytest is configured to run these benchmarks as plain tests (i.e., no benchmarking). To run
274
298
a benchmark with timing measurements, use the `--benchmark-enable` when invoking `pytest`.
275
299
276
-
The benchmarks are run as part of the continuous integration suite through [codspeed](https://codspeed.io/zarr-developers/zarr-python).
300
+
The benchmarks are run as part of the continuous integration suite through [codspeed](https://codspeed.io/zarr-developers/zarr-python).
0 commit comments