Skip to content

Commit e4376b8

Browse files
authored
Merge pull request #768 from blink1073/make-hooks-manual
2 parents ef02c13 + 91cba5e commit e4376b8

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,20 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
# Run "pre-commit run --all-files"
13+
# Run "pre-commit run --all-files --hook-stage=manual"
1414
pre-commit:
1515
name: Run pre-commit hook
16-
1716
runs-on: ubuntu-latest
18-
timeout-minutes: 2
19-
20-
env:
21-
PYTHON_VERSION: 3.8
22-
17+
timeout-minutes: 5
2318
steps:
2419
- name: Checkout
2520
uses: actions/checkout@v2
26-
27-
- name: Set up Python ${{ env.PYTHON_VERSION }}
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: ${{ env.PYTHON_VERSION }}
31-
21+
- name: Set up Python
22+
uses: actions/setup-python@v3
3223
- name: Run pre-commit
3324
uses: pre-commit/[email protected]
34-
25+
with:
26+
extra_args: --all-files --hook-stage=manual
3527
- name: Help message if pre-commit fail
3628
if: ${{ failure() }}
3729
run: |
@@ -41,7 +33,7 @@ jobs:
4133
echo "or you can run by hand on staged files with"
4234
echo " pre-commit run"
4335
echo "or after-the-fact on already committed files with"
44-
echo " pre-commit run --all-files"
36+
echo " pre-commit run --all-files --hook-stage=manual"
4537
4638
build-n-test-n-coverage:
4739
name: Build, test and code coverage

.pre-commit-config.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
ci:
2-
skip: [check-jsonschema]
3-
41
repos:
52
- repo: https://github.com/pre-commit/pre-commit-hooks
63
rev: v4.1.0
@@ -34,6 +31,13 @@ repos:
3431
hooks:
3532
- id: prettier
3633

34+
- repo: https://github.com/PyCQA/doc8
35+
rev: 0.11.1
36+
hooks:
37+
- id: doc8
38+
args: [--max-line-length=200]
39+
stages: [manual]
40+
3741
- repo: https://github.com/pycqa/flake8
3842
rev: 4.0.1
3943
hooks:
@@ -44,6 +48,7 @@ repos:
4448
"flake8-logging-format==0.6.0",
4549
"flake8-implicit-str-concat==0.2.0",
4650
]
51+
stages: [manual]
4752

4853
- repo: https://github.com/PyCQA/doc8
4954
rev: 0.11.1
@@ -59,3 +64,4 @@ repos:
5964
files: ^\.github/workflows/
6065
types: [yaml]
6166
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
67+
stages: [manual]

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ _file:///my/projects/jupyter_client/docs/\_build/html/index.html_
5757

5858
## Contributing
5959

60-
jupyter-client has adopted automatic code formatting so you shouldn't
60+
`jupyter-client` has adopted automatic code formatting so you shouldn't
6161
need to worry too much about your code style.
6262
As long as your code is valid,
6363
the pre-commit hook should take care of how it should look.
@@ -76,3 +76,6 @@ If you have already committed files before setting up the pre-commit
7676
hook with `pre-commit install`, you can fix everything up using
7777
`pre-commit run --all-files`. You need to make the fixing commit
7878
yourself after that.
79+
80+
Some of the hooks only run on CI by default, but you can invoke them by
81+
running with the `--hook-stage manual` argument.

0 commit comments

Comments
 (0)