Skip to content

Commit 9f1e0fb

Browse files
committed
Format codebase
1 parent e7caa9a commit 9f1e0fb

16 files changed

Lines changed: 60 additions & 55 deletions

File tree

‎extensions/fine_agent_pi/fine_agent_pi/install_pi_handler.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ async def run(
6161
except (OSError, icommandrunner.CommandNotLaunchableError) as error:
6262
self.logger.error(f"Install failed: {error}")
6363
return SetupSystemRunResult(
64-
failed=[f"{_TOOL_NAME}: {backend_support.spawn_error(cmd[0], error)}"]
64+
failed=[
65+
f"{_TOOL_NAME}: {backend_support.spawn_error(cmd[0], error)}"
66+
]
6567
)
6668
await process.wait_for_end()
6769
await progress.advance(1)

‎extensions/fine_agent_pi/fine_agent_pi/install_pi_packages_handler.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ async def run(
350350
if installed_sources:
351351
check_cmd = ["pi", "list", "--approve"]
352352
try:
353-
check_process = await self.command_runner.run(check_cmd, cwd=cwd, env=env)
353+
check_process = await self.command_runner.run(
354+
check_cmd, cwd=cwd, env=env
355+
)
354356
except (OSError, icommandrunner.CommandNotLaunchableError) as error:
355357
self.logger.warning(backend_support.spawn_error(check_cmd[0], error))
356358
return SetupSystemRunResult(failed=failed)

‎extensions/fine_python_pip/tests/test_install_deps_in_env_handler.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_pip_cmd_argv_is_exact() -> None:
7878
"-e",
7979
"file:///D:/a/pkg[a]",
8080
"other>=1.0",
81-
"pkg ; python_version < \"3.12\"",
81+
'pkg ; python_version < "3.12"',
8282
]
8383

8484

‎extensions/fine_python_ruff/tests/test_lsp_fix_applicability.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ def __init__(self, output: str) -> None:
6666
self._output = output
6767
self.commands: list[list[str]] = []
6868

69-
async def run(
70-
self, cmd: icommandrunner.Argv, cwd=None, env=None
71-
):
69+
async def run(self, cmd: icommandrunner.Argv, cwd=None, env=None):
7270
icommandrunner.check_argv(cmd)
7371
self.commands.append(list(cmd))
7472
return _StubProcess(self._output)

‎finecode_extension_api/src/finecode_extension_api/interfaces/icommandrunner.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,4 @@ def run_sync(
204204
same refusals and `OSError` on an unstartable program — minus the
205205
process-group option.
206206
"""
207-
...
207+
...

‎finecode_extension_api/tests/test_lsp_service.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,9 @@ async def test_file_open_event_sends_utf8_file_content_in_did_open(
420420
file_path.write_bytes(_NON_ASCII.encode("utf-8"))
421421

422422
async with _running_service(file_path, _NON_ASCII) as (service, session, _):
423-
await service._handle_file_event(
424-
ifileeditor.FileOpenEvent(file_path=file_path)
425-
)
423+
await service._handle_file_event(ifileeditor.FileOpenEvent(file_path=file_path))
426424

427-
did_open = [
428-
n for n in session.notifications if n.method == "textDocument/didOpen"
429-
]
425+
did_open = [n for n in session.notifications if n.method == "textDocument/didOpen"]
430426
assert len(did_open) == 1
431427
assert did_open[0].params["textDocument"]["text"] == _NON_ASCII
432428

‎finecode_extension_runner/tests/test_command_runner_argv.py‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
from pathlib import Path
1717

1818
import pytest
19-
2019
from finecode_extension_api.interfaces import icommandrunner
2120

2221
from finecode_extension_runner.impls.command_runner import (
23-
_prepare_argv,
2422
CommandRunner,
2523
CommandRunnerConfig,
24+
_prepare_argv,
2625
)
2726
from finecode_extension_runner.process_slots import ProcessSlots
2827

@@ -77,7 +76,12 @@ def _runner_with_slots() -> tuple[CommandRunner, ProcessSlots]:
7776
async def test_arguments_arrive_verbatim() -> None:
7877
"""The point of exec: nothing reinterpreted, nothing quoted away."""
7978
process = await _runner().run(
80-
[sys.executable, "-c", "import json,sys; print(json.dumps(sys.argv[1:]))", *_ARGS]
79+
[
80+
sys.executable,
81+
"-c",
82+
"import json,sys; print(json.dumps(sys.argv[1:]))",
83+
*_ARGS,
84+
]
8185
)
8286
await process.wait_for_end()
8387

@@ -86,7 +90,12 @@ async def test_arguments_arrive_verbatim() -> None:
8690

8791
def test_run_sync_arguments_arrive_verbatim() -> None:
8892
process = _runner().run_sync(
89-
[sys.executable, "-c", "import json,sys; print(json.dumps(sys.argv[1:]))", *_ARGS]
93+
[
94+
sys.executable,
95+
"-c",
96+
"import json,sys; print(json.dumps(sys.argv[1:]))",
97+
*_ARGS,
98+
]
9099
)
91100
process.wait_for_end()
92101

@@ -267,4 +276,4 @@ def explode(*args: object, **kwargs: object) -> str | None:
267276
platform="linux",
268277
which=explode,
269278
)
270-
assert argv == ["npm", "install"]
279+
assert argv == ["npm", "install"]

‎finecode_extension_runner/tests/test_command_runner_concurrency.py‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ async def test_second_run_does_not_spawn_until_first_process_exits() -> None:
4343
)
4444
loop = asyncio.get_running_loop()
4545

46-
task1 = asyncio.create_task(runner.run([sys.executable, "-c", "import time; time.sleep(0.3)"]))
46+
task1 = asyncio.create_task(
47+
runner.run([sys.executable, "-c", "import time; time.sleep(0.3)"])
48+
)
4749
# Give task1 a head start so it acquires the slot first.
4850
await asyncio.sleep(0.05)
49-
task2 = asyncio.create_task(runner.run([sys.executable, "-c", "import time; time.sleep(0.01)"]))
51+
task2 = asyncio.create_task(
52+
runner.run([sys.executable, "-c", "import time; time.sleep(0.01)"])
53+
)
5054

5155
start1 = loop.time()
5256
proc1 = await task1
@@ -107,9 +111,13 @@ async def test_configured_limit_still_caps_below_the_gate() -> None:
107111
)
108112
loop = asyncio.get_running_loop()
109113

110-
task1 = asyncio.create_task(runner.run([sys.executable, "-c", "import time; time.sleep(0.2)"]))
114+
task1 = asyncio.create_task(
115+
runner.run([sys.executable, "-c", "import time; time.sleep(0.2)"])
116+
)
111117
await asyncio.sleep(0.05)
112-
task2 = asyncio.create_task(runner.run([sys.executable, "-c", "import time; time.sleep(0.01)"]))
118+
task2 = asyncio.create_task(
119+
runner.run([sys.executable, "-c", "import time; time.sleep(0.01)"])
120+
)
113121

114122
start2 = loop.time()
115123
proc2 = await task2

‎finecode_extension_runner/tests/test_command_runner_teardown.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
)
2424
from finecode_extension_runner.process_slots import ProcessSlots
2525

26-
2726
# Process groups, `killpg`/`SIGKILL` and `os.kill(pid, 0)` (which is
2827
# `CTRL_C_EVENT` on Windows) are all POSIX-only.
2928
pytestmark = pytest.mark.skipif(
@@ -168,8 +167,7 @@ async def test_is_alive_tracks_the_group_after_a_forking_launcher_exits() -> Non
168167
# instead -- it is set the moment the launcher itself dies.
169168
deadline = asyncio.get_running_loop().time() + 5.0
170169
while (
171-
process.get_exit_code() is None
172-
and asyncio.get_running_loop().time() < deadline
170+
process.get_exit_code() is None and asyncio.get_running_loop().time() < deadline
173171
):
174172
await asyncio.sleep(0.05)
175173

‎finecode_extension_runner/tests/test_file_manager.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from finecode_extension_runner.impls.file_manager import FileManager
1111

12-
1312
# Em dash, right double quote, é and 😀 — no newline, so the byte assertions
1413
# below do not depend on Windows \n→\r\n translation. The right double quote
1514
# (U+201D) and 😀 are outside cp1252, so a cp1252 read raises instead of

0 commit comments

Comments
 (0)