style: apply ruff format to fix CI lint failure
CI / lint (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 1m0s
CI / quality (pull_request) Successful in 1m26s
CI / security (pull_request) Successful in 1m55s
CI / build (pull_request) Successful in 34s
CI / helm (pull_request) Successful in 38s
CI / push-validation (pull_request) Successful in 42s
CI / unit_tests (pull_request) Successful in 5m41s
CI / integration_tests (pull_request) Successful in 9m34s
CI / docker (pull_request) Successful in 1m42s
CI / coverage (pull_request) Successful in 11m2s
CI / status-check (pull_request) Successful in 3s

This commit is contained in:
2026-06-10 00:32:24 -04:00
committed by drew
parent 97b5424bd2
commit bcc4400080
2 changed files with 14 additions and 17 deletions
@@ -10,14 +10,14 @@ from behave import given, then, when
from behave.runner import Context
_SCRIPT_PATH = Path(__file__).parent.parent.parent / "scripts" / "check-quality-gates.py"
_SCRIPT_PATH = (
Path(__file__).parent.parent.parent / "scripts" / "check-quality-gates.py"
)
def _load_quality_gates_module() -> types.ModuleType:
"""Load the check-quality-gates.py script as a module via importlib."""
spec = importlib.util.spec_from_file_location(
"check_quality_gates", _SCRIPT_PATH
)
spec = importlib.util.spec_from_file_location("check_quality_gates", _SCRIPT_PATH)
if spec is None or spec.loader is None:
raise ImportError(f"Cannot load module from {_SCRIPT_PATH}")
mod = importlib.util.module_from_spec(spec)
+10 -13
View File
@@ -47,15 +47,15 @@ def validate_path(path_str: str, project_root: Path | None = None) -> Path:
# Check for dangerous patterns that could be used for injection
dangerous_patterns = [
"..", # Path traversal
";", # Command separator
"|", # Pipe operator
"&", # Background/AND operator
"$", # Variable/command substitution
"`", # Backtick command substitution (deprecated)
"(", # Subshell grouping start
")", # Subshell grouping end
"<", # Input redirection
">", # Output redirection
";", # Command separator
"|", # Pipe operator
"&", # Background/AND operator
"$", # Variable/command substitution
"`", # Backtick command substitution (deprecated)
"(", # Subshell grouping start
")", # Subshell grouping end
"<", # Input redirection
">", # Output redirection
"\n", # Newline injection
"\r", # Carriage return injection
"\\n", # Escaped newline injection in feature/CLI input
@@ -86,10 +86,7 @@ def validate_path(path_str: str, project_root: Path | None = None) -> Path:
try:
resolved.relative_to(project_root_resolved)
except ValueError as e:
msg = (
f"Path {resolved} is outside project root "
f"{project_root_resolved}"
)
msg = f"Path {resolved} is outside project root {project_root_resolved}"
raise ValueError(msg) from e
return resolved