Skip to content

Commit

Permalink
ci(github): run pre-commit on PRs
Browse files Browse the repository at this point in the history
add a workflow that runs on all PRs that checks whether pre-commit
passes on the series as a whole. Note that this does not necessarily
ensure that each individual commit in the series passes QA checks.
  • Loading branch information
Nicholas Sielicki committed Mar 11, 2024
1 parent df02be4 commit 485972d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Run All pre-commit Hooks

on:
pull_request:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Contributions via pull requests are much appreciated. Before sending us a pull r
To send us a pull request, please:

1. Fork the repository.
1. Install [pre-commit](https://pre-commit.com/) through your preferred mechanism (eg: `pip install`), then run `pre-commit install` **inside this repo**. This will ensure that a collection of [git hooks](./.pre-commit-config.yaml) run on each of your commits, which help minimize your diffs and avoid nitpicking.
1. Install [pre-commit](https://pre-commit.com/) through your preferred mechanism (eg: `pip install`), then run `pre-commit install` **inside this repo**. This will ensure that a collection of [git hooks](./.pre-commit-config.yaml) run on each of your commits, which help minimize your diffs and avoid nitpicking. This runs under GitHub actions on every pull request, so running it locally can help you catch issues before posting.
1. Optionally, run `git config blame.ignoreRevsFile .git-blame-ignore-revs` to make `git blame` output more accurate.
1. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
1. Ensure local tests pass.
Expand Down

0 comments on commit 485972d

Please sign in to comment.