mirror of
https://github.com/rookiestar28/ComfyUI-OpenClaw.git
synced 2026-08-14 00:48:07 +00:00
style: apply supply-chain checker formatting
This commit is contained in:
@@ -17,7 +17,6 @@ from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable
|
||||
|
||||
|
||||
AFFECTED_NPM_PREFIXES = (
|
||||
"@tanstack/",
|
||||
"@uipath/",
|
||||
@@ -165,8 +164,12 @@ def check_npm_lock(lock_path: Path) -> list[Finding]:
|
||||
return findings
|
||||
|
||||
|
||||
_REQ_NAME_RE = re.compile(r"^\s*([A-Za-z0-9_.-]+)\s*(?:\[.*?\])?\s*(?:[<>=!~]=|==|~=|>|<|$)")
|
||||
_TOML_DEP_RE = re.compile(r"""["']([A-Za-z0-9_.-]+)(?:\[.*?\])?\s*(?:[<>=!~]=|==|~=|>|<|["'])""")
|
||||
_REQ_NAME_RE = re.compile(
|
||||
r"^\s*([A-Za-z0-9_.-]+)\s*(?:\[.*?\])?\s*(?:[<>=!~]=|==|~=|>|<|$)"
|
||||
)
|
||||
_TOML_DEP_RE = re.compile(
|
||||
r"""["']([A-Za-z0-9_.-]+)(?:\[.*?\])?\s*(?:[<>=!~]=|==|~=|>|<|["'])"""
|
||||
)
|
||||
|
||||
|
||||
def check_python_manifest(path: Path) -> list[Finding]:
|
||||
|
||||
@@ -52,7 +52,9 @@ class TestSupplyChainWorkflowPolicy(unittest.TestCase):
|
||||
text,
|
||||
re.compile(r"uses: Comfy-Org/publish-node-action@[a-f0-9]{40}\b"),
|
||||
)
|
||||
self.assertIn("personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}", text)
|
||||
self.assertIn(
|
||||
"personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}", text
|
||||
)
|
||||
|
||||
def test_dependency_review_gate_is_present_for_dependency_diffs(self):
|
||||
text = (WORKFLOW_ROOT / "dependency-review.yml").read_text(encoding="utf-8")
|
||||
|
||||
@@ -65,7 +65,9 @@ class TestSupplyChainHardening(unittest.TestCase):
|
||||
def test_affected_python_requirement_is_reported(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
(root / "requirements.txt").write_text("mistralai==2.4.6\n", encoding="utf-8")
|
||||
(root / "requirements.txt").write_text(
|
||||
"mistralai==2.4.6\n", encoding="utf-8"
|
||||
)
|
||||
|
||||
findings = hardening.run_checks(root)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user