Skip to content

Commit

Permalink
clean up pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Apr 8, 2022
1 parent 3130a2e commit 4ede2d2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ jobs:
run: |
codecov
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
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"
test_docs:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,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,8 +51,20 @@ repos:
"flake8-logging-format==0.6.0",
"flake8-implicit-str-concat==0.2.0",
]
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.12.0
hooks:
- id: eslint
stages: [manual]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.2
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
files: ^\.github/workflows/
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
stages: [manual]
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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 ipykernel

Releasing ipykernel is _almost_ standard for a Python package:
Expand Down

0 comments on commit 4ede2d2

Please sign in to comment.