mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 23:14:55 +02:00
Migrate type checker to ty
Much faster than mypy. Matches usage of ruff from same developer.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user