Skip to content

Commit e835b31

Browse files
Use precommit CI bot (#438)
1 parent 83c1e0a commit e835b31

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ repos:
4040
hooks:
4141
- id: pyupgrade
4242
args: [--py38-plus]
43+
44+
ci:
45+
autofix_prs: false
46+
autofix_commit_msg: "[pre-commit.ci 🤖] Apply code format tools to PR"
47+
autoupdate_schedule: monthly

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,33 @@ Then run `make teams`.
4040
A self-hosted version of [Plausible.io](https://plausible.io) is used to gather simple
4141
and privacy-friendly analytics for the site. The dashboard can be accessed
4242
[here](https://views.scientific-python.org/scientific-python.org).
43+
44+
## Development instructions
45+
46+
If you wish to contribute to scientific-python.org:
47+
48+
1. Fork and clone the repository
49+
2. Create a new branch with your proposed feature or change to the package repository
50+
51+
### Code Style / Pre-commit
52+
53+
We use `pre-commit` to ensure the code style is consistent. To install pre-commit locally:
54+
55+
1. First install pre-commit: `pip install pre-commit`
56+
2. Install all of the pre-commit hooks by running `pre-commit install`
57+
58+
Once you have `pre-commit` installed, the code stylers and linters
59+
defined in the `.pre-commit-config.yaml` will run each time you
60+
commit modified changes to git locally.
61+
62+
### Precommit.ci Bot
63+
64+
We use the pre-commit CI bot to run linting tests and to auto fix
65+
pull requests. How it works:
66+
67+
- Pre-commit.ci will run the CI checks via a CI run in the PR.
68+
- After the PR is approved but before it's merged, a maintainer can run the bot to apply linting fixes via a commit to the PR. To run the bot write:
69+
70+
`pre-commit.ci autofix` in a comment in the PR. This will trigger another CI run to double check that the linting / code style fixes are as expected. Then you can merge!
71+
72+
NOTE: the pre-commit CI bot CI action will allow you to see what checks pass. It will also remind you of the command to autofix the code in the pr.

0 commit comments

Comments
 (0)