Skip to content

Commit

Permalink
Replace flake8, pyupgrade, isort and black with ruff (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Nov 25, 2024
1 parent d328e17 commit dd23608
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 32 deletions.
28 changes: 5 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,12 @@ repos:
- id: check-builtin-literals
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
files: \.py$

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
Expand All @@ -48,14 +38,6 @@ repos:
args: [--max-line-length=200]
stages: [manual]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ docs = [
"pydata-sphinx-theme"
]

[tool.black]
[tool.ruff]
line-length = 100

[tool.isort]
profile = "black"
exclude = ["binder"]

[tool.hatch.version]
source = "nodejs"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def test_room_concurrent_initialization(

async def connect(file_format, file_type, file_path):
websocket, room_name = await rtc_connect_doc_client(file_format, file_type, file_path)
async with websocket as ws:
async with websocket:
pass

t0 = time()
Expand All @@ -87,7 +87,7 @@ async def test_room_sequential_opening(
async def connect(file_format, file_type, file_path):
t0 = time()
websocket, room_name = await rtc_connect_doc_client(file_format, file_type, file_path)
async with websocket as ws:
async with websocket:
pass
t1 = time()
return t1 - t0
Expand Down
1 change: 1 addition & 0 deletions ui-tests/jupyter_server_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
opens the server to the world and provide access to JupyterLab
JavaScript objects through the global window variable.
"""

from typing import Any

from jupyterlab.galata import configure_jupyter_server
Expand Down
6 changes: 3 additions & 3 deletions ui-tests/tests/data/OutputExamples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"outputs": [],
"source": [
"from IPython.display import display\n",
"from IPython.display import HTML, Image, Latex, Math, Markdown, SVG"
"from IPython.display import HTML, Image, Latex, Markdown, SVG"
]
},
{
Expand Down Expand Up @@ -118,7 +118,7 @@
"source": [
"import sys\n",
"\n",
"print('this is stderr', file=sys.stderr)"
"print(\"this is stderr\", file=sys.stderr)"
]
},
{
Expand Down Expand Up @@ -389,7 +389,7 @@
"import numpy as np\n",
"from IPython.display import set_matplotlib_formats\n",
"\n",
"set_matplotlib_formats('pdf')"
"set_matplotlib_formats(\"pdf\")"
]
},
{
Expand Down

0 comments on commit dd23608

Please sign in to comment.