Explorar o código

fix(yabai): update typing

Joe hai 1 ano
pai
achega
188d32f430
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      .config/yabai/yabai.py

+ 7 - 2
.config/yabai/yabai.py

@@ -1,11 +1,13 @@
 #!/usr/bin/env python3
 #!/usr/bin/env python3
-from os.path import exists
+
+# pyright: strict, reportAny=false, reportExplicitAny=false, reportUnusedCallResult=false
+
 from json import loads
 from json import loads
 from logging import NOTSET, basicConfig, debug, info
 from logging import NOTSET, basicConfig, debug, info
 from os import getenv
 from os import getenv
 from subprocess import CalledProcessError, check_output
 from subprocess import CalledProcessError, check_output
 from sys import argv
 from sys import argv
-from typing import Any, TypeAlias
+from typing import Any, Literal, TypeAlias, cast, override
 
 
 HOME = getenv("HOME")
 HOME = getenv("HOME")
 XDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME")
 XDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME")
@@ -27,6 +29,7 @@ class Window:
     def size(self) -> int:
     def size(self) -> int:
         return self.frame_w * self.frame_h
         return self.frame_w * self.frame_h
 
 
+    @override
     def __repr__(self) -> str:
     def __repr__(self) -> str:
         return (
         return (
             f"Window({self.title} | {self.app}"
             f"Window({self.title} | {self.app}"
@@ -47,6 +50,7 @@ class Space:
         self.has_focus: bool = data["has-focus"]
         self.has_focus: bool = data["has-focus"]
         self.is_native_fullscreen: bool = data["is-native-fullscreen"]
         self.is_native_fullscreen: bool = data["is-native-fullscreen"]
 
 
+    @override
     def __repr__(self) -> str:
     def __repr__(self) -> str:
         return (
         return (
             f"Space({self.label if self.label and len(self.label) > 0 else '<NoLabel>'}"
             f"Space({self.label if self.label and len(self.label) > 0 else '<NoLabel>'}"
@@ -69,6 +73,7 @@ class YabaiDisplay:
         self.spaces: list[str] = data["spaces"]
         self.spaces: list[str] = data["spaces"]
         self.frame: dict[str, int] = data["frame"]
         self.frame: dict[str, int] = data["frame"]
 
 
+    @override
     def __repr__(self) -> str:
     def __repr__(self) -> str:
         return (
         return (
             f"Display({self.label if self.label and len(self.label) > 0 else '<NoLabel>'}"
             f"Display({self.label if self.label and len(self.label) > 0 else '<NoLabel>'}"