Skip to content

Commit

Permalink
Bump pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
vxgmichel committed Nov 14, 2023
1 parent 80129a6 commit 888bcbf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.8.0
rev: "23.10.1"
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: "6.1.0"
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
rev: "v4.5.0"
hooks:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.982"
rev: "v1.7.0"
hooks:
- id: mypy
additional_dependencies: [
Expand Down
1 change: 0 additions & 1 deletion gambaterm/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class AudioOut:

output_rate: float = 48000.0
buffer_size: int = int(output_rate // 60)

Expand Down
2 changes: 0 additions & 2 deletions gambaterm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def main(
with create_app_session() as app_session:
with app_session.input.raw_mode():
try:

# Detect color mode
if args.color_mode is None:
args.color_mode = detect_local_color_mode(app_session)
Expand All @@ -135,7 +134,6 @@ def main(
with input_context as get_gb_input:
player = no_audio if args.disable_audio else audio_player
with player(console, args.speed_factor) as audio_out:

# Run the emulator
run(
console,
Expand Down
1 change: 0 additions & 1 deletion gambaterm/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def run(

# Loop over emulator frames
for i in count():

# Add total deltas
if frame_start_time is not None:
total_deltas.append(time.perf_counter() - frame_start_time)
Expand Down
8 changes: 5 additions & 3 deletions gambaterm/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ async def safe_ssh_process_handler(process: SSHServerProcess[str]) -> None:
except KeyboardInterrupt:
result = 1
except SystemExit as e:
result = e.code or 0
if isinstance(e.code, int):
result = e.code
else:
result = 1 if e.code else 0
except BaseException:
traceback.print_exc()
result = 1
Expand All @@ -74,7 +77,7 @@ async def ssh_process_handler(process: SSHServerProcess[str]) -> int:
# Check command
if command is not None:
parser = argparse.ArgumentParser()
parser._print_message = lambda message, file=None: type(parser)._print_message( # type: ignore[assignment]
parser._print_message = lambda message, file=None: type(parser)._print_message( # type: ignore[method-assign]
parser, message, file=cast(IO[str], process.stdout)
)
add_optional_arguments(parser)
Expand Down Expand Up @@ -313,7 +316,6 @@ def main(

# Run an executor with no limit on the number of threads
with ThreadPoolExecutor(max_workers=32) as executor:

# Run the server in asyncio
asyncio.run(run_server(app_config, executor))

Expand Down
2 changes: 1 addition & 1 deletion gambaterm/ssh_app_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def terminal_size_changed(
return original_method(width, height, pixheight, pixwidth)

try:
process.terminal_size_changed = terminal_size_changed # type: ignore[assignment]
process.terminal_size_changed = terminal_size_changed # type: ignore[method-assign]
yield
finally:
del process.terminal_size_changed
Expand Down

0 comments on commit 888bcbf

Please sign in to comment.