From 42241efbc2e95699a4210c7c7ce0c3916b7f59c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 18:58:25 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.15.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.5...v0.15.2) - [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.19.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.0...v1.19.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0aba36a..a910df5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.5.5 + rev: v0.15.2 hooks: # Run the linter. - id: ruff @@ -12,7 +12,7 @@ repos: pass_filenames: false - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.0 + rev: v1.19.1 hooks: - id: mypy additional_dependencies: ["types-pyyaml"] From a2c17deea504a4b53d51598285c020b959f159e3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 18:58:35 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/textmate_grammar/elements.py | 3 ++- src/textmate_grammar/handler.py | 2 +- src/textmate_grammar/utils/logger.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/textmate_grammar/elements.py b/src/textmate_grammar/elements.py index e026e9b..cfec9cd 100644 --- a/src/textmate_grammar/elements.py +++ b/src/textmate_grammar/elements.py @@ -2,9 +2,10 @@ from abc import ABC from collections import defaultdict +from collections.abc import Generator from itertools import groupby from pprint import pprint -from typing import TYPE_CHECKING, Generator +from typing import TYPE_CHECKING from .handler import POS, ContentHandler, Match, Pattern from .utils.logger import LOGGER diff --git a/src/textmate_grammar/handler.py b/src/textmate_grammar/handler.py index 3b675bb..47b9646 100644 --- a/src/textmate_grammar/handler.py +++ b/src/textmate_grammar/handler.py @@ -1,7 +1,7 @@ from __future__ import annotations +from collections.abc import Callable from pathlib import Path -from typing import Callable import charset_normalizer as charset from onigurumacffi import _Match as Match diff --git a/src/textmate_grammar/utils/logger.py b/src/textmate_grammar/utils/logger.py index 0a607e0..baef92c 100644 --- a/src/textmate_grammar/utils/logger.py +++ b/src/textmate_grammar/utils/logger.py @@ -114,7 +114,7 @@ def format_message( else: msg_id = "." * self.max_token_length - vb_message = f"{'|'*(depth-1)}{'-'*bool(depth)}{message}" + vb_message = f"{'|' * (depth - 1)}{'-' * bool(depth)}{message}" if len(vb_message) > MAX_LENGTH: half_length = min([(MAX_LENGTH - 6) // 2, (len(vb_message) - 6) // 2])