mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Pygments does not need type checking globally ignored anymore
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -106,7 +106,7 @@ jobs:
|
||||
${{ runner.os }}-golang-static-
|
||||
|
||||
- name: Install build-only deps
|
||||
run: python -m pip install -r docs/requirements.txt ruff mypy types-requests types-docutils
|
||||
run: python -m pip install -r docs/requirements.txt ruff mypy types-requests types-docutils types-Pygments
|
||||
|
||||
- name: Run ruff
|
||||
run: ruff check .
|
||||
|
||||
15
docs/conf.py
15
docs/conf.py
@@ -18,8 +18,9 @@ from typing import Any, Callable, Dict, Iterable, Iterator, List, Tuple
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst.roles import set_classes
|
||||
from pygments.lexer import RegexLexer, bygroups # type: ignore
|
||||
from pygments.token import Comment, Error, Keyword, Literal, Name, Number, String, Whitespace # type: ignore
|
||||
from pygments.lexer import RegexLexer
|
||||
from pygments.lexer import bygroups as untyped_bygroups
|
||||
from pygments.token import Comment, Error, Keyword, Literal, Name, Number, String, Whitespace
|
||||
from sphinx import addnodes, version_info
|
||||
from sphinx.util.logging import getLogger
|
||||
|
||||
@@ -367,7 +368,11 @@ def replace_string(app: Any, docname: str, source: List[str]) -> None: # {{{
|
||||
# config file docs {{{
|
||||
|
||||
|
||||
class ConfLexer(RegexLexer): # type: ignore
|
||||
def bygroups(*args: Any) -> Any:
|
||||
return untyped_bygroups(*args) # type: ignore[no-untyped-call]
|
||||
|
||||
|
||||
class ConfLexer(RegexLexer):
|
||||
name = 'Conf'
|
||||
aliases = ['conf']
|
||||
filenames = ['*.conf']
|
||||
@@ -401,7 +406,7 @@ class ConfLexer(RegexLexer): # type: ignore
|
||||
else:
|
||||
break
|
||||
|
||||
def mapargs(self: RegexLexer, match: 're.Match[str]') -> Iterator[Tuple[int, Any, str]]:
|
||||
def mapargs(self: 'ConfLexer', match: 're.Match[str]') -> Iterator[Tuple[int, Any, str]]:
|
||||
start_pos = match.start()
|
||||
val = match.group()
|
||||
parts = val.split(maxsplit=1)
|
||||
@@ -465,7 +470,7 @@ class ConfLexer(RegexLexer): # type: ignore
|
||||
}
|
||||
|
||||
|
||||
class SessionLexer(RegexLexer): # type: ignore
|
||||
class SessionLexer(RegexLexer):
|
||||
name = 'Session'
|
||||
aliases = ['session']
|
||||
filenames = ['*.session']
|
||||
|
||||
Reference in New Issue
Block a user