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
+30-6Lines changed: 30 additions & 6 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`.
0 commit comments