Skip to content

Commit c8469c6

Browse files
committed
Add: precommit CI config to repo
1 parent 41b0900 commit c8469c6

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@ repos:
4040
hooks:
4141
- id: pyupgrade
4242
args: [--py38-plus]
43+
44+
ci:
45+
# This ensures that pr's aren't autofixed by the bot, rather you call
46+
# the bot to make the fix
47+
autofix_prs: false
48+
autofix_commit_msg: |
49+
'[pre-commit.ci 🤖] Apply code format tools to PR'
50+
# Update hook versions every month (so we don't get hit with weekly update pr's)
51+
autoupdate_schedule: monthly

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,15 @@ We use `pre-commit` to ensure the code style is consistent. To install pre-commi
5252
Once you have `pre-commit` installed, the code stylers and linters
5353
defined in the `pre-commit-config.yaml` will run each time you
5454
commit modified changes to git locally.
55+
56+
### Precommit.ci Bot
57+
58+
We use the pre-commit CI bot to run linting tests and to auto fix
59+
pull requests. How it works:
60+
61+
- Pre-commit.ci will run the CI checks via a CI run in the PR.
62+
- 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:
63+
64+
`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!
65+
66+
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)