style: fix ruff format violations in devcontainer_autodiscovery_wiring_steps.py
CI / status-check (push) Blocked by required conditions
CI / benchmark-regression (push) Has been skipped
CI / helm (push) Successful in 45s
CI / push-validation (push) Successful in 43s
CI / quality (push) Successful in 1m29s
CI / build (push) Successful in 1m7s
CI / lint (push) Successful in 1m39s
CI / typecheck (push) Successful in 1m54s
CI / security (push) Successful in 1m55s
CI / e2e_tests (push) Successful in 4m48s
CI / unit_tests (push) Successful in 5m45s
CI / integration_tests (push) Successful in 6m13s
CI / docker (push) Successful in 1m32s
CI / coverage (push) Failing after 19m57s
CI / benchmark-publish (push) Successful in 1h18m32s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 1m14s
CI / typecheck (pull_request) Successful in 1m24s
CI / security (pull_request) Successful in 1m25s
CI / helm (pull_request) Successful in 38s
CI / push-validation (pull_request) Successful in 38s
CI / build (pull_request) Successful in 1m6s
CI / benchmark-regression (pull_request) Failing after 1m36s
CI / unit_tests (pull_request) Successful in 4m51s
CI / integration_tests (pull_request) Successful in 4m15s
CI / e2e_tests (pull_request) Failing after 4m35s
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled

Apply ruff auto-format to resolve CI lint failure: long lines in subprocess.run() calls and list comprehensions were not wrapped to the project's line-length limit.
This commit was merged in pull request #10907.
This commit is contained in:
2026-05-05 15:03:33 +00:00
committed by Forgejo
parent 3d7afb4378
commit 0ce2e14f2d
@@ -57,15 +57,21 @@ def _init_git_repo(tmpdir: str, extra_files: dict[str, str] | None = None) -> st
subprocess.run(["git", "init"], cwd=tmpdir, capture_output=True, check=True)
subprocess.run(
["git", "config", "user.email", "test@dcwire.dev"],
cwd=tmpdir, capture_output=True, check=True,
cwd=tmpdir,
capture_output=True,
check=True,
)
subprocess.run(
["git", "config", "user.name", "DCWire Test"],
cwd=tmpdir, capture_output=True, check=True,
cwd=tmpdir,
capture_output=True,
check=True,
)
subprocess.run(
["git", "config", "commit.gpgSign", "false"],
cwd=tmpdir, capture_output=True, check=True,
cwd=tmpdir,
capture_output=True,
check=True,
)
# Always create a README so there is at least one tracked file
readme = Path(tmpdir) / "README.md"
@@ -80,7 +86,9 @@ def _init_git_repo(tmpdir: str, extra_files: dict[str, str] | None = None) -> st
subprocess.run(["git", "add", "."], cwd=tmpdir, capture_output=True, check=True)
subprocess.run(
["git", "commit", "-m", "init"],
cwd=tmpdir, capture_output=True, check=True,
cwd=tmpdir,
capture_output=True,
check=True,
)
return tmpdir
@@ -132,7 +140,9 @@ def step_dcwire_git_no_devcontainer(ctx):
ctx.dcwire_last_dc_child = None
@given('dcwire a git repo with a subdirectory "src" and a ".devcontainer/devcontainer.json" file')
@given(
'dcwire a git repo with a subdirectory "src" and a ".devcontainer/devcontainer.json" file'
)
def step_dcwire_git_with_src_and_devcontainer(ctx):
tmpdir = tempfile.mkdtemp(prefix="dcwire-git-src-")
_create_devcontainer_dir(tmpdir, ".devcontainer/devcontainer.json")
@@ -178,7 +188,9 @@ def step_dcwire_fs_with_root_devcontainer(ctx):
ctx.dcwire_last_dc_child = None
@given('dcwire a filesystem directory with a ".devcontainer/frontend/devcontainer.json" named config')
@given(
'dcwire a filesystem directory with a ".devcontainer/frontend/devcontainer.json" named config'
)
def step_dcwire_fs_with_named_devcontainer(ctx):
tmpdir = tempfile.mkdtemp(prefix="dcwire-fs-named-")
_create_devcontainer_dir(tmpdir, ".devcontainer/frontend/devcontainer.json")
@@ -199,7 +211,9 @@ def step_dcwire_fs_no_devcontainer(ctx):
ctx.dcwire_last_dc_child = None
@given('dcwire a filesystem directory with a subdirectory "lib" and a ".devcontainer/devcontainer.json" file')
@given(
'dcwire a filesystem directory with a subdirectory "lib" and a ".devcontainer/devcontainer.json" file'
)
def step_dcwire_fs_with_lib_and_devcontainer(ctx):
tmpdir = tempfile.mkdtemp(prefix="dcwire-fs-lib-")
lib_dir = Path(tmpdir) / "lib"
@@ -258,7 +272,8 @@ def step_dcwire_has_devcontainer_child(ctx, name):
assert ctx.dcwire_error is None, f"Unexpected error: {ctx.dcwire_error}"
assert ctx.dcwire_result is not None, "Expected a list of children"
dc_children = [
r for r in ctx.dcwire_result
r
for r in ctx.dcwire_result
if r.resource_type_name == "devcontainer-instance" and r.name == name
]
assert len(dc_children) == 1, (
@@ -273,7 +288,8 @@ def step_dcwire_has_fs_child(ctx, name):
assert ctx.dcwire_error is None, f"Unexpected error: {ctx.dcwire_error}"
assert ctx.dcwire_result is not None, "Expected a list of children"
fs_children = [
r for r in ctx.dcwire_result
r
for r in ctx.dcwire_result
if r.resource_type_name == "fs-directory" and r.name == name
]
assert len(fs_children) == 1, (
@@ -287,9 +303,7 @@ def step_dcwire_has_provisioning_state(ctx, state):
assert ctx.dcwire_last_dc_child is not None, "No devcontainer child captured"
props = ctx.dcwire_last_dc_child.properties or {}
actual = props.get("provisioning_state")
assert actual == state, (
f"Expected provisioning_state='{state}', got '{actual}'"
)
assert actual == state, f"Expected provisioning_state='{state}', got '{actual}'"
@then("dcwire the devcontainer child has devcontainer_json_path set")
@@ -318,8 +332,7 @@ def step_dcwire_no_devcontainer_children(ctx):
assert ctx.dcwire_error is None, f"Unexpected error: {ctx.dcwire_error}"
assert ctx.dcwire_result is not None, "Expected a list of children"
dc_children = [
r for r in ctx.dcwire_result
if r.resource_type_name == "devcontainer-instance"
r for r in ctx.dcwire_result if r.resource_type_name == "devcontainer-instance"
]
assert len(dc_children) == 0, (
f"Expected no devcontainer-instance children, got {[r.name for r in dc_children]}"