style: format code with ruff

This commit is contained in:
Violin
2026-07-26 17:11:10 +01:00
parent 1e04f565b0
commit 6860f30876
4 changed files with 6 additions and 20 deletions
+4 -9
View File
@@ -3,11 +3,11 @@
from __future__ import annotations
from typing import Any, Literal
from pydantic import BaseModel, ConfigDict, Field
from . import state
# ---------------------------------------------------------------------------
# Pydantic v2 Models
# ---------------------------------------------------------------------------
@@ -77,9 +77,7 @@ class RecordHypothesisArgsModel(BaseModel):
" no-results/unavailable outcomes are allowed."
),
)
test_command: str = Field(
"", description="Exact syntax tested, including argument order"
)
test_command: str = Field("", description="Exact syntax tested, including argument order")
test_response: str = Field("", description="Exact decisive response or error")
verification_status: str = ""
rejection_reason: str = Field(
@@ -112,8 +110,7 @@ class ExecArgsModel(BaseModel):
background: bool = Field(
False,
description=(
"Run as a tracked background process; use status/cancel for lifecycle"
" management"
"Run as a tracked background process; use status/cancel for lifecycle management"
),
)
@@ -297,9 +294,7 @@ class TargetArgsModel(BaseModel):
eng_dir: str = Field(
..., description="engagement dir (required; target resolution is engagement-scoped)"
)
scope: str = Field(
"", description="explicit scope.yaml path (else $ENG_DIR/scope/scope.yaml)"
)
scope: str = Field("", description="explicit scope.yaml path (else $ENG_DIR/scope/scope.yaml)")
host: str = Field("", description="in-scope IP/CIDR to resolve")
role: str = Field("", description="named role from scope.yaml targets.roles (e.g. web)")
field: Literal["ip", "url", "host"] = Field("ip", description="what to print (default ip)")
-1
View File
@@ -8,7 +8,6 @@ from __future__ import annotations
import contextlib
import re
import shlex
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
+2 -8
View File
@@ -198,9 +198,7 @@ def _has_target_literal_in_segment(seg: CommandSegment) -> bool:
words = seg.words
executable = seg.executable
skip_code = (
executable in _SCRIPT_INTERPRETERS
and executable not in _SHELL_WRAPPERS
and "-c" in words
executable in _SCRIPT_INTERPRETERS and executable not in _SHELL_WRAPPERS and "-c" in words
)
c_index = words.index("-c") if skip_code else -1
for index, word in enumerate(words):
@@ -252,11 +250,7 @@ def _is_local_compilation_or_test(seg: CommandSegment) -> bool:
"doctest",
}:
return True
return (
"py_compile" in seg.raw_text
or "pytest" in lower_words
or "unittest" in lower_words
)
return "py_compile" in seg.raw_text or "pytest" in lower_words or "unittest" in lower_words
def _block_terminal_segment(seg: CommandSegment) -> str | None: