From bcf5ffe73ffe99e939dcc3554aa111fb5757f962 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 Aug 2026 19:25:27 +0530 Subject: [PATCH] Ensforce Python formatting in CI --- .github/workflows/ci.py | 2 ++ kitty/shaders/slang.py | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index a7514ba4f..b83f429b1 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -348,6 +348,8 @@ def main() -> None: q = '\n'.join(filter(lambda x: not x.rstrip().endswith('_generated.go'), q.strip().splitlines())).strip() if q: raise SystemExit(q) + if subprocess.run(['ruff', 'format', '--check']).returncode != 0: + raise SystemExit('Some Python files are not formatted correctly') elif action == 'check-dependencies': check_dependencies() else: diff --git a/kitty/shaders/slang.py b/kitty/shaders/slang.py index 9ff676a5b..4fc244ef4 100644 --- a/kitty/shaders/slang.py +++ b/kitty/shaders/slang.py @@ -1096,6 +1096,7 @@ def is_valid_slot(x: str) -> TypeGuard[Slot]: VALID_VAR_TYPES: frozenset[str] = frozenset({'uint', 'int', 'float', 'double', 'bool'}) + @run_once def identifiers_pat() -> re.Pattern[str]: return re.compile(r'^[A-Za-z_][A-Za-z0-9_]*$')