Skip to content

Commit 74557f9

Browse files
authored
Use ruff format and fix docs warning (#230)
* Use ruff format and fix docs warning * fix codespell
1 parent b779e56 commit 74557f9

File tree

4 files changed

+11
-27
lines changed

4 files changed

+11
-27
lines changed

.pre-commit-config.yaml

+2-6
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,11 @@ repos:
4242
- id: blacken-docs
4343
additional_dependencies: [black==23.7.0]
4444

45-
- repo: https://github.com/psf/black-pre-commit-mirror
46-
rev: 23.9.1
47-
hooks:
48-
- id: black
49-
5045
- repo: https://github.com/codespell-project/codespell
5146
rev: "v2.2.6"
5247
hooks:
5348
- id: codespell
54-
args: ["-L", "sur,nd"]
49+
args: ["-L", "incase"]
5550

5651
- repo: https://github.com/pre-commit/pygrep-hooks
5752
rev: "v1.10.0"
@@ -63,6 +58,7 @@ repos:
6358
- repo: https://github.com/astral-sh/ruff-pre-commit
6459
rev: v0.0.292
6560
hooks:
61+
- id: ruff-format
6662
- id: ruff
6763
args: ["--fix", "--show-fixes"]
6864

doc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
# Theme options are theme-specific and customize the look and feel of a theme
107107
# further. For a list of options available for each theme, see the
108108
# documentation.
109-
# html_theme_options = {}
109+
html_theme_options = {"navigation_with_keys": False}
110110

111111
# Add any paths that contain custom themes here, relative to this directory.
112112
# html_theme_path = []

pyproject.toml

+7-17
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,18 @@ test = "mypy --install-types --non-interactive {args}"
5252

5353
[tool.hatch.envs.lint]
5454
dependencies = [
55-
"black[jupyter]==23.3.0",
5655
"mdformat>0.7",
5756
"mdformat-gfm>=0.3.5",
58-
"ruff==0.0.270"
57+
"ruff==0.1.2"
5958
]
6059
[tool.hatch.envs.lint.scripts]
6160
style = [
61+
"ruff format {args:.}",
6262
"ruff {args:.}",
63-
"black --check --diff {args:.}",
6463
"mdformat --check {args:doc *.md}"
6564
]
6665
fmt = [
67-
"black {args:.}",
66+
"ruff format {args:.}",
6867
"ruff --fix {args:.}",
6968
"mdformat {args:doc *.md}"
7069
]
@@ -114,23 +113,15 @@ show_error_codes = true
114113
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
115114
warn_unreachable = true
116115

117-
[tool.black]
118-
line-length = 100
119-
skip-string-normalization = true
120-
target-version = ["py38"]
121-
extend-exclude = "^tests.*ipynb$"
122-
123116
[tool.ruff]
124117
target-version = "py38"
125118
line-length = 100
126119
select = [
127120
"A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "ISC", "N",
128-
"PLC", "PLE", "PLR", "PLW", "Q", "RUF", "S", "SIM", "T", "TID", "UP",
121+
"PLC", "PLE", "PLR", "PLW", "RUF", "S", "SIM", "T", "TID", "UP",
129122
"W", "YTT",
130123
]
131124
ignore = [
132-
# Q000 Single quotes found but double quotes preferred
133-
"Q000",
134125
# FBT001 Boolean positional arg in function definition
135126
"FBT001", "FBT002", "FBT003",
136127
# E501 Line too long (158 > 100 characters)
@@ -141,6 +132,8 @@ ignore = [
141132
"T201",
142133
# N802 Function name `CreateWellKnownSid` should be lowercase
143134
"N802", "N803",
135+
# Rules that conflict with the formatter.
136+
"ISC001", "W191",
144137
]
145138
unfixable = [
146139
# Don't touch print statements
@@ -170,8 +163,5 @@ ignore-nested-classes=true
170163
fail-under=100
171164
exclude = ["demos", "doc", "tests"]
172165

173-
[tool.codespell]
174-
ignore-words-list = "incase"
175-
176166
[tool.repo-review]
177-
ignore = ["PY007", "PP308", "GH102", "PC140"]
167+
ignore = ["PY007", "PP308", "GH102", "PC140", "PC110"]

terminado/management.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@ async def shutdown(self) -> None:
288288
"""Shutdown the manager."""
289289
await self.kill_all()
290290
if not self._blocking_io_executor_is_external:
291-
self.blocking_io_executor.shutdown(
292-
wait=False, cancel_futures=True
293-
) # type:ignore[call-arg]
291+
self.blocking_io_executor.shutdown(wait=False, cancel_futures=True) # type:ignore[call-arg]
294292

295293
async def kill_all(self) -> None:
296294
"""Kill all terminals."""

0 commit comments

Comments
 (0)