Skip to content

Commit 7a7bcb3

Browse files
authored
refactor: harden ruff rules (jxmorris12#174)
1 parent 94339f1 commit 7a7bcb3

27 files changed

Lines changed: 2521 additions & 1837 deletions

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
# Ruff for linting and formatting
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.15.12 # Keep in sync ruff version with pyproject.toml
4+
rev: v0.15.16 # Keep in sync ruff version with pyproject.toml
55
hooks:
66
# Run the linter
77
- id: ruff
@@ -11,7 +11,7 @@ repos:
1111

1212
# mypy for type checking
1313
- repo: https://github.com/pre-commit/mirrors-mypy
14-
rev: v2.0.0 # Keep in sync mypy version with pyproject.toml
14+
rev: v2.1.0 # Keep in sync mypy version with pyproject.toml
1515
hooks:
1616
- id: mypy
1717
args: [--config-file=pyproject.toml]

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@
9999
- `download_folder` in `utils.find_existing_language_tool_downloads` from `str` to `Path`
100100
- Edited return types of some methods/functions:
101101
- from `str` to `Path` in `utils.get_language_tool_download_path`
102-
- from `List[str]` to `List[Path]` in `utils.find_existing_language_tool_downloads`
102+
- from `list[str]` to `list[Path]` in `utils.find_existing_language_tool_downloads`
103103
- from `str` to `Path` in `utils.get_language_tool_directory`
104-
- from `Tuple[str, str]` to `Tuple[Path, Path]` in `utils.get_jar_info`
104+
- from `tuple[str, str]` to `tuple[Path, Path]` in `utils.get_jar_info`

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ install:
1313
uv sync --all-groups --locked
1414

1515
format:
16-
uv run --group quality --locked ruff format language_tool_python tests
16+
uv run --group quality --locked ruff format
1717

1818
fix:
19-
uv run --group quality --locked ruff check --fix language_tool_python tests
19+
uv run --group quality --locked ruff check --fix
2020

2121
ruff-check:
22-
uv run --group quality --locked ruff check language_tool_python tests
23-
uv run --group quality --locked ruff format --check language_tool_python tests
22+
uv run --group quality --locked ruff check
23+
uv run --group quality --locked ruff format --check
2424

2525
mypy-check:
2626
@if uv run --locked python -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)'; then \

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,11 @@ Exit codes:
308308
- `LTP_JAR_DIR_PATH`: use an existing local LanguageTool directory (skip download).
309309
- `LTP_DOWNLOAD_HOST_SNAPSHOT`: override snapshot download host.
310310
- default: `https://internal1.languagetool.org/snapshots/`
311-
- `LTP_DOWNLOAD_HOST_RELEASE`: override release download host.
311+
- `LTP_DOWNLOAD_HOST_NEW_RELEASES`: override release download host for LanguageTool `>= 6.7`.
312+
- default: `https://github.com/jxmorris12/language_tool_python/releases/download/LanguageTool-{version}/`
313+
- `LTP_DOWNLOAD_HOST_RELEASE`: override release download host for LanguageTool `6.0` to `6.6`.
312314
- default: `https://languagetool.org/download/`
313-
- `LTP_DOWNLOAD_HOST_ARCHIVE`: override archive download host.
315+
- `LTP_DOWNLOAD_HOST_ARCHIVE`: override archive download host for LanguageTool `4.0` to `5.9`.
314316
- default: `https://languagetool.org/download/archive/`
315317
- `LTP_DOWNLOAD_SHA256_<VERSION>`: version-specific expected SHA-256 for the downloaded LanguageTool archive, for example `LTP_DOWNLOAD_SHA256_6_9_SNAPSHOT`.
316318
- `LTP_DOWNLOAD_SHA256`: fallback expected SHA-256 for the downloaded LanguageTool archive.

language_tool_python/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""LanguageTool API for Python."""
22

33
__all__ = [
4+
"LanguageTag",
45
"LanguageTool",
56
"LanguageToolPublicAPI",
6-
"LanguageTag",
77
"Match",
8-
"utils",
98
"exceptions",
9+
"utils",
1010
]
1111

1212
import logging

0 commit comments

Comments
 (0)