Skip to content

Commit dd23608

Browse files
Replace flake8, pyupgrade, isort and black with ruff (jupyterlab#407)
1 parent d328e17 commit dd23608

File tree

5 files changed

+13
-32
lines changed

5 files changed

+13
-32
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,12 @@ repos:
2424
- id: check-builtin-literals
2525
- id: trailing-whitespace
2626

27-
- repo: https://github.com/psf/black
28-
rev: 22.12.0
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: v0.8.0
2929
hooks:
30-
- id: black
31-
32-
- repo: https://github.com/PyCQA/isort
33-
rev: 5.12.0
34-
hooks:
35-
- id: isort
36-
files: \.py$
37-
38-
- repo: https://github.com/asottile/pyupgrade
39-
rev: v3.3.1
40-
hooks:
41-
- id: pyupgrade
42-
args: [--py37-plus]
30+
- id: ruff
31+
args: [ --fix ]
32+
- id: ruff-format
4333

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

51-
- repo: https://github.com/pycqa/flake8
52-
rev: 6.0.0
53-
hooks:
54-
- id: flake8
55-
additional_dependencies:
56-
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
57-
stages: [manual]
58-
5941
- repo: https://github.com/pre-commit/mirrors-mypy
6042
rev: v0.991
6143
hooks:

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ docs = [
3636
"pydata-sphinx-theme"
3737
]
3838

39-
[tool.black]
39+
[tool.ruff]
4040
line-length = 100
41-
42-
[tool.isort]
43-
profile = "black"
41+
exclude = ["binder"]
4442

4543
[tool.hatch.version]
4644
source = "nodejs"

tests/test_documents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def test_room_concurrent_initialization(
6161

6262
async def connect(file_format, file_type, file_path):
6363
websocket, room_name = await rtc_connect_doc_client(file_format, file_type, file_path)
64-
async with websocket as ws:
64+
async with websocket:
6565
pass
6666

6767
t0 = time()
@@ -87,7 +87,7 @@ async def test_room_sequential_opening(
8787
async def connect(file_format, file_type, file_path):
8888
t0 = time()
8989
websocket, room_name = await rtc_connect_doc_client(file_format, file_type, file_path)
90-
async with websocket as ws:
90+
async with websocket:
9191
pass
9292
t1 = time()
9393
return t1 - t0

ui-tests/jupyter_server_test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
opens the server to the world and provide access to JupyterLab
88
JavaScript objects through the global window variable.
99
"""
10+
1011
from typing import Any
1112

1213
from jupyterlab.galata import configure_jupyter_server

ui-tests/tests/data/OutputExamples.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"from IPython.display import display\n",
24-
"from IPython.display import HTML, Image, Latex, Math, Markdown, SVG"
24+
"from IPython.display import HTML, Image, Latex, Markdown, SVG"
2525
]
2626
},
2727
{
@@ -118,7 +118,7 @@
118118
"source": [
119119
"import sys\n",
120120
"\n",
121-
"print('this is stderr', file=sys.stderr)"
121+
"print(\"this is stderr\", file=sys.stderr)"
122122
]
123123
},
124124
{
@@ -389,7 +389,7 @@
389389
"import numpy as np\n",
390390
"from IPython.display import set_matplotlib_formats\n",
391391
"\n",
392-
"set_matplotlib_formats('pdf')"
392+
"set_matplotlib_formats(\"pdf\")"
393393
]
394394
},
395395
{

0 commit comments

Comments
 (0)