Skip to content

Commit

Permalink
Clean up pre-commit (#6349)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Apr 9, 2022
1 parent 2a391f6 commit 7ae20a7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,12 @@ jobs:
- name: Install Jupyterlab
run: pip install -e .
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage=manual
- name: Help message if pre-commit fail
if: ${{ failure() }}
run: |
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"
16 changes: 10 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ci:
# skip any check that needs internet access
skip: [check-jsonschema, prettier, eslint, integrity]
skip: [prettier, integrity]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -33,6 +33,13 @@ repos:
files: \.py$
args: [--profile=black]

- 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 @@ -43,6 +50,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.2
Expand All @@ -52,6 +60,7 @@ repos:
files: ^\.github/workflows/
types: [yaml]
args: ['--schemafile', 'https://json.schemastore.org/github-workflow']
stages: [manual]

- repo: local
hooks:
Expand All @@ -60,11 +69,6 @@ repos:
entry: 'npm run prettier:files'
language: node
types_or: [json, markdown, ts, tsx, javascript, jsx, css]
- id: eslint
name: eslint
entry: 'npm run eslint:files'
language: node
types_or: [ts, tsx, javascript, jsx]
- id: integrity
name: integrity
entry: 'npm run integrity --force'
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ You may also use the prettier npm script (e.g. `npm run prettier` or
We recommend installing a prettier extension for your code editor and
configuring it to format your code with a keyboard shortcut or
automatically on save.

Some of the hooks only run on CI by default, but you can invoke them by
running with the `--hook-stage manual` argument.
10 changes: 5 additions & 5 deletions docs/source/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
.. Main Jupyter notebook links
.. _Notebook Basics: notebook_p2_
.. _notebook_p2: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/Notebook%20Basics.ipynb
.. _notebook_p2: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/docs/source/examples/Notebook/Notebook%20Basics.ipynb

.. _Running Code in the Jupyter Notebook: notebook_p1_
.. _notebook_p1: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/Running%20Code.ipynb
.. _notebook_p1: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/docs/source/examples/Notebook/Running%20Code.ipynb

.. Other python projects
.. _matplotlib: https://matplotlib.org
Expand All @@ -33,9 +33,9 @@
.. _Markdown: https://daringfireball.net/projects/markdown/syntax

.. _Rich Output: notebook_p5_
.. _notebook_p5: https://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Rich%20Output.ipynb
.. _notebook_p5: https://nbviewer.jupyter.org/github/ipython/ipython/blob/main/examples/IPython%20Kernel/Rich%20Output.ipynb

.. _Plotting with Matplotlib: notebook_p3_
.. _notebook_p3: https://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Plotting%20in%20the%20Notebook.ipynb
.. _notebook_p3: https://nbviewer.jupyter.org/github/ipython/ipython/blob/main/examples/IPython%20Kernel/Plotting%20in%20the%20Notebook.ipynb

.. _Working with Markdown Cells: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/Working%20With%20Markdown%20Cells.ipynb
.. _Working with Markdown Cells: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/docs/source/examples/Notebook/Working%20With%20Markdown%20Cells.ipynb
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ timeout = 300
# timeout_method = "thread"
filterwarnings = [
"error",
# Pending release of https://github.com/jupyterlab/jupyterlab_server/pull/259
"ignore:metadata:DeprecationWarning",
"ignore:There is no current event loop:DeprecationWarning",
]

0 comments on commit 7ae20a7

Please sign in to comment.