Skip to content
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.8 # Keep in sync ruff version with pyproject.toml
rev: v0.17.1 # Keep in sync ruff version with pyproject.toml
hooks:
# Run the linter
- id: ruff
Expand All @@ -11,14 +11,14 @@ repos:

# mypy for type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.3.1 # Keep in sync mypy version with pyproject.toml
rev: v2.4.0 # Keep in sync mypy version with pyproject.toml
hooks:
- id: mypy
args: [--config-file=pyproject.toml]

# zizmor for github actions linting
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.30.1 # Keep in sync zizmor version with pyproject.toml
rev: v1.31.1 # Keep in sync zizmor version with pyproject.toml
hooks:
- id: zizmor
args: [--no-progress, --fix, --persona=auditor]
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ types = [

quality = [
# Keep in sync mypy version with .pre-commit-config.yaml
"mypy==2.3.1",
"mypy==2.4.0",
# Keep in sync ruff version with .pre-commit-config.yaml
"ruff==0.16.8",
"ruff==0.17.1",
# Keep in sync zizmor version with .pre-commit-config.yaml
"zizmor==1.29.0"
"zizmor==1.31.1; python_version >= '3.11'",
"zizmor==1.29.0; python_version < '3.11'",
]


Expand Down
10 changes: 3 additions & 7 deletions src/language_tool_python/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import time
import urllib.parse
import warnings
from typing import TYPE_CHECKING, ClassVar, Literal, cast
from typing import TYPE_CHECKING, ClassVar, Literal

import psutil
import requests
Expand Down Expand Up @@ -54,7 +54,6 @@
from collections.abc import Mapping
from pathlib import Path
from types import TracebackType
from typing import IO

from .config_file import ConfigValue

Expand Down Expand Up @@ -1237,11 +1236,8 @@ def _terminate_server(self) -> None:
with contextlib.suppress(ValueError):
_RUNNING_SERVER_PROCESSES.remove(self._server)

# stdin is IO[Any], so cast it back to the
# text stream that text=True actually gives us
stdin = cast("IO[str] | None", self._server.stdin)
if stdin:
stdin.close()
if self._server.stdin:
self._server.stdin.close()

# Release the server process object
self._server = None
Expand Down
Loading
Loading