Skip to content

Commit 6a448fe

Browse files
authored
Merge pull request #270 from Wolfvin/fix/ci-unmasked-failures
fix: sarif f-string SyntaxError + _auto_setup gate regression (unmasked by #266)
2 parents 763ed95 + bdbfca7 commit 6a448fe

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

scripts/codelens.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,15 +1445,16 @@ def main():
14451445
)
14461446

14471447
# ─── Auto-setup: if command needs registry and none exists, bootstrap it ────
1448-
# Commands that need a registry to work meaningfully
1449-
_REGISTRY_COMMANDS = {
1450-
"search", "context", "deps", "audit", "security",
1451-
"summary", "impact", "api-map", "doctor", "history",
1452-
"graph",
1453-
}
1448+
# `scan` BUILDS the registry; `plugin`/`lsp` don't read it. Every other
1449+
# command — visible umbrella OR hidden leaf (list, query, ...) — consumes the
1450+
# registry and benefits from auto-setup when it's absent. Deriving the gate
1451+
# from this small exclusion set (rather than a hand-maintained allowlist)
1452+
# avoids the stale-list bug that let audit/security/deps/doctor and the hidden
1453+
# leaf commands slip through the gate (issue #244).
1454+
_NON_REGISTRY_COMMANDS = {"scan", "plugin", "lsp"}
14541455

14551456
auto_setup_info = None
1456-
if args.command in _REGISTRY_COMMANDS and not _registry_exists(workspace):
1457+
if args.command not in _NON_REGISTRY_COMMANDS and not _registry_exists(workspace):
14571458
auto_setup_result = _auto_setup(workspace)
14581459
if auto_setup_result.get("auto_setup") == "ok":
14591460
auto_setup_info = {

scripts/formatters/sarif.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,12 @@ def to_sarif(data: Dict, command: str = "", workspace: str = "",
462462

463463
# Add workspace info
464464
if workspace:
465+
# Note: the .replace() is kept out of the f-string expression — a
466+
# backslash inside an f-string `{...}` is a SyntaxError on Python < 3.12.
467+
workspace_uri = workspace.replace('\\', '/')
465468
run["originalUriBaseIds"] = {
466469
"%SRCROOT%": {
467-
"uri": f"file://{workspace.replace('\\', '/')}/",
470+
"uri": f"file://{workspace_uri}/",
468471
}
469472
}
470473

0 commit comments

Comments
 (0)