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
- [Building the documentation locally](#building-the-documentation-locally)
33
+
- [Publishing the documentation](#publishing-the-documentation)
34
+
- [Docstrings and API documentation](#docstrings-and-api-documentation)
36
35
37
36
## Set up
38
37
@@ -223,15 +222,19 @@ add_two_integers(1, 2)
223
222
224
223
Running `pre-commit install` will set up [pre-commit hooks](https://pre-commit.com/) to ensure the code is
225
224
formatted correctly. Currently, these are:
226
-
*[black](https://black.readthedocs.io/en/stable/) for code structure formatting (maximum line length set to 88)
225
+
*[ruff](https://github.com/charliermarsh/ruff) does a number of jobs, including linting, auto-formatting code (with `ruff-format`), and sorting import statements.
227
226
*[mypy](https://mypy.readthedocs.io/en/stable/index.html) a static type checker
228
-
*[ruff](https://github.com/charliermarsh/ruff) does a number of jobs, including enforcing PEP8 and sorting imports
227
+
*[check-manifest](https://github.com/mgedmin/check-manifest) to ensure that the right files are included in the pip package.
228
+
*[codespell](https://github.com/codespell-project/codespell) to check for common misspellings.
229
+
229
230
230
231
These will prevent code from being committed if any of these hooks fail. To run them individually:
231
232
```bash
232
-
ruff .
233
-
black ./
233
+
ruff check --fix # Lint all files in the current directory, and fix any fixable errors.
234
+
ruff format # Format all files in the current directory.
234
235
mypy -p my_awesome_software
236
+
check-manifest
237
+
codespell
235
238
```
236
239
237
240
You can also execute all the hooks using `pre-commit run`. The best time to run this is after you have staged your changes, but before you commit them.
0 commit comments