Skip to content

Commit

Permalink
Merge pull request #768 from blink1073/make-hooks-manual
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Apr 11, 2022
2 parents ef02c13 + 91cba5e commit e4376b8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ concurrency:
cancel-in-progress: true

jobs:
# Run "pre-commit run --all-files"
# Run "pre-commit run --all-files --hook-stage=manual"
pre-commit:
name: Run pre-commit hook

runs-on: ubuntu-latest
timeout-minutes: 2

env:
PYTHON_VERSION: 3.8

timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up Python
uses: actions/setup-python@v3
- name: Run pre-commit
uses: pre-commit/[email protected]

with:
extra_args: --all-files --hook-stage=manual
- name: Help message if pre-commit fail
if: ${{ failure() }}
run: |
Expand All @@ -41,7 +33,7 @@ jobs:
echo "or you can run by hand on staged files with"
echo " pre-commit run"
echo "or after-the-fact on already committed files with"
echo " pre-commit run --all-files"
echo " pre-commit run --all-files --hook-stage=manual"
build-n-test-n-coverage:
name: Build, test and code coverage
Expand Down
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
ci:
skip: [check-jsonschema]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
Expand Down Expand Up @@ -34,6 +31,13 @@ repos:
hooks:
- id: prettier

- repo: https://github.com/PyCQA/doc8
rev: 0.11.1
hooks:
- id: doc8
args: [--max-line-length=200]
stages: [manual]

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
Expand All @@ -44,6 +48,7 @@ repos:
"flake8-logging-format==0.6.0",
"flake8-implicit-str-concat==0.2.0",
]
stages: [manual]

- repo: https://github.com/PyCQA/doc8
rev: 0.11.1
Expand All @@ -59,3 +64,4 @@ repos:
files: ^\.github/workflows/
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
stages: [manual]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _file:///my/projects/jupyter_client/docs/\_build/html/index.html_

## Contributing

jupyter-client has adopted automatic code formatting so you shouldn't
`jupyter-client` has adopted automatic code formatting so you shouldn't
need to worry too much about your code style.
As long as your code is valid,
the pre-commit hook should take care of how it should look.
Expand All @@ -76,3 +76,6 @@ If you have already committed files before setting up the pre-commit
hook with `pre-commit install`, you can fix everything up using
`pre-commit run --all-files`. You need to make the fixing commit
yourself after that.

Some of the hooks only run on CI by default, but you can invoke them by
running with the `--hook-stage manual` argument.

0 comments on commit e4376b8

Please sign in to comment.