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 #6349

Merged
merged 4 commits 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/action@v2.0.0
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we still need that jupyterlab_server release (2.12.1 or 2.13?) before being able to remove it.

Noticed in #6369.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

"ignore:There is no current event loop:DeprecationWarning",
]