Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up pre-commit #1757

Merged
merged 1 commit into from Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -75,3 +75,24 @@ jobs:

- name: Code coverage
run: codecov

# Run "pre-commit run --all-files --hook-stage=manual"
pre-commit:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: pre-commit/action@v2.0.0
with:
extra_args: --all-files --hook-stage=manual
- name: Help message if pre-commit fail
if: ${{ failure() }}
run: |
echo "You can install pre-commit hooks to automatically run formatting"
echo "on each commit with:"
echo " pre-commit install"
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 --hook-stage=manual"
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
@@ -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 @@ -30,6 +27,7 @@ repos:
- id: isort
files: \.py$
args: [--profile=black]
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.1
Expand All @@ -47,6 +45,7 @@ repos:
hooks:
- id: doc8
args: [--max-line-length=200]
stages: [manual]

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

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.1
Expand All @@ -67,3 +67,4 @@ repos:
files: ^\.github/workflows/
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
stages: [manual]
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -62,6 +62,9 @@ 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.

# Releasing

If you are going to release a version of `nbconvert` you should also be capable
Expand Down