Skip to content

Commit db8d62a

Browse files
committed
formatters linters
1 parent 916240c commit db8d62a

6 files changed

Lines changed: 21 additions & 6 deletions

File tree

gambaterm/controller_input.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ def pygame_button_pressed_context(
5050
try:
5151
import pygame
5252
except ImportError:
53-
raise SystemExit("""\
53+
raise SystemExit(
54+
"""\
5455
The pygame library is not available, which is required to get controller support.
5556
Please use the following command to install gambaterm with controller support:
5657
pip3 install gambaterm[controller-support]
57-
""")
58+
"""
59+
)
5860

5961
pygame.init()
6062
pygame.joystick.init()

gambaterm/libgambatte.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class GB:
1010
SGB_MODE = ...
1111
READONLY_SAV = ...
1212
NO_BIOS = ...
13-
1413
def load(self, rom_file: str, flags: int = 0) -> int: ...
1514
def run_for(
1615
self,

gambaterm/octant.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from __future__ import annotations
1010

11+
__all__ = ["OCTANT", "OCTANT_BYTES", "blit_octant"]
12+
1113
from bisect import bisect_left
1214

1315
# 26 octant bit patterns that map to pre-existing block element characters
@@ -79,7 +81,11 @@ def _build_octant_table() -> list[str]:
7981
OCTANT_BYTES = [ch.encode("utf-8") for ch in OCTANT]
8082

8183
# Initialize Cython blitter with lookup table
82-
from .octblit import blit_octant, clear_cache as _clear_cache, init_table # noqa: E402, F401
84+
from .octblit import ( # noqa: E402, F401
85+
blit_octant,
86+
clear_cache as _clear_cache,
87+
init_table,
88+
)
8389

8490
init_table(OCTANT_BYTES)
8591

gambaterm/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from typing import Callable, Deque, Iterator
1010

1111
import numpy as np
12+
import numpy.typing as npt
1213
from prompt_toolkit.application import AppSession
1314

1415
from .termblit import blit
@@ -127,7 +128,7 @@ def run(
127128
# Prepare buffers with invalid data
128129
video = np.full((console.HEIGHT, console.WIDTH), 0, np.uint32)
129130
audio = np.full((2 * console.TICKS_IN_FRAME, 2), -0x7FFF, np.int16)
130-
last_frame = video.copy()
131+
last_frame: npt.NDArray[np.uint32] | None = video.copy()
131132

132133
# Determine rendering mode based on terminal size.
133134
# Pick the highest-resolution mode whose grid fits the terminal.

gambaterm/sextant.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
from __future__ import annotations
88

9+
__all__ = ["SEXTANT", "SEXTANT_BYTES", "blit_sextant"]
10+
911

1012
def _build_sextant_table() -> list[str]:
1113
"""Build lookup table mapping 6-bit pattern to Unicode sextant character.

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ def get_extensions() -> list[Extension]:
7373
sources=["termblit_ext/octblit.pyx"],
7474
)
7575

76-
return [gambatte_extension, termblit_extension, sextblit_extension, octblit_extension]
76+
return [
77+
gambatte_extension,
78+
termblit_extension,
79+
sextblit_extension,
80+
octblit_extension,
81+
]
7782

7883

7984
setup(ext_modules=get_extensions())

0 commit comments

Comments
 (0)