Skip to content

Commit

Permalink
Use ruff format and fix docs warning
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Oct 25, 2023
1 parent b779e56 commit 2ab2629
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ repos:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
Expand All @@ -63,6 +58,7 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
hooks:
- id: ruff-format
- id: ruff
args: ["--fix", "--show-fixes"]

Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
html_theme_options = {"navigation_with_keys": False}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
Expand Down
24 changes: 7 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,18 @@ test = "mypy --install-types --non-interactive {args}"

[tool.hatch.envs.lint]
dependencies = [
"black[jupyter]==23.3.0",
"mdformat>0.7",
"mdformat-gfm>=0.3.5",
"ruff==0.0.270"
"ruff==0.1.2"
]
[tool.hatch.envs.lint.scripts]
style = [
"ruff format {args:.}",
"ruff {args:.}",
"black --check --diff {args:.}",
"mdformat --check {args:doc *.md}"
]
fmt = [
"black {args:.}",
"ruff format {args:.}",
"ruff --fix {args:.}",
"mdformat {args:doc *.md}"
]
Expand Down Expand Up @@ -114,23 +113,15 @@ show_error_codes = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true

[tool.black]
line-length = 100
skip-string-normalization = true
target-version = ["py38"]
extend-exclude = "^tests.*ipynb$"

[tool.ruff]
target-version = "py38"
line-length = 100
select = [
"A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "ISC", "N",
"PLC", "PLE", "PLR", "PLW", "Q", "RUF", "S", "SIM", "T", "TID", "UP",
"PLC", "PLE", "PLR", "PLW", "RUF", "S", "SIM", "T", "TID", "UP",
"W", "YTT",
]
ignore = [
# Q000 Single quotes found but double quotes preferred
"Q000",
# FBT001 Boolean positional arg in function definition
"FBT001", "FBT002", "FBT003",
# E501 Line too long (158 > 100 characters)
Expand All @@ -141,6 +132,8 @@ ignore = [
"T201",
# N802 Function name `CreateWellKnownSid` should be lowercase
"N802", "N803",
# Rules that conflict with the formatter.
"ISC001", "W191",
]
unfixable = [
# Don't touch print statements
Expand Down Expand Up @@ -170,8 +163,5 @@ ignore-nested-classes=true
fail-under=100
exclude = ["demos", "doc", "tests"]

[tool.codespell]
ignore-words-list = "incase"

[tool.repo-review]
ignore = ["PY007", "PP308", "GH102", "PC140"]
ignore = ["PY007", "PP308", "GH102", "PC140", "PC110"]
4 changes: 1 addition & 3 deletions terminado/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,7 @@ async def shutdown(self) -> None:
"""Shutdown the manager."""
await self.kill_all()
if not self._blocking_io_executor_is_external:
self.blocking_io_executor.shutdown(
wait=False, cancel_futures=True
) # type:ignore[call-arg]
self.blocking_io_executor.shutdown(wait=False, cancel_futures=True) # type:ignore[call-arg]

async def kill_all(self) -> None:
"""Kill all terminals."""
Expand Down

0 comments on commit 2ab2629

Please sign in to comment.