Migrate type checker to ty

Much faster than mypy. Matches usage of ruff from same developer.
This commit is contained in:
Kovid Goyal
2026-07-04 09:16:05 +05:30
parent bb452f2066
commit a65b4c70a7
45 changed files with 218 additions and 238 deletions

View File

@@ -6,6 +6,7 @@ import os
import re
import subprocess
import sys
import types
from kitty.conf.generate import write_output
@@ -45,7 +46,7 @@ def main(args: list[str]=sys.argv) -> None:
all_colors = []
special_colors = []
for opt in definition.iter_all_options():
if callable(opt.parser_func):
if isinstance(opt.parser_func, types.FunctionType):
match opt.parser_func.__name__:
case 'to_color':
all_colors.append(opt.name)

View File

@@ -605,7 +605,7 @@ def load_ref_map() -> dict[str, dict[str, str]]:
raw = f.read()
raw = raw.split('{', 1)[1].split('}', 1)[0]
data = json.loads(bytes(bytearray(json.loads(f'[{raw}]'))))
return data # type: ignore
return data
def generate_constants() -> str: