runs and runs compare print target text without the control-character cleaning the reports use
还没有人认领这个 Issue。
评估
调研方向
从 internal/cli/runs.go 中的 runRunsCompare(约第 308-322 行)和 printRunRow(第 88-98 行)开始,这里的 Title、Location、Target 和 Extra 未经转义直接输出。阅读 internal/report/doc.go(第 576-583 行)和 terminal.go 中已有的清理逻辑,以便复用,例如将其导出为 report.CleanText。完成标准是:runs 和 runs compare 的文本输出中不再包含来自 ledger 内容的 C0/C1 控制字符。通过一个测试验证:该测试存储一条 title 和 location 中含有 ESC 字节的 finding,并使用 go test ./internal/cli ./internal/report 运行。
由索引模型根据 Issue 内容生成。
描述
Summary
The report renderers strip control characters from target-derived text before printing (internal/report/doc.go:576-583), so a scanned repository cannot move the cursor or retitle the operator's terminal. spackle runs compare and the spackle runs list print finding titles, file locations and targets from the ledger without that cleaning.
Where
internal/cli/runs.go:308-322(runRunsComparetext output)internal/cli/runs.go:88-98(printRunRow)internal/report/doc.go:576-583,internal/report/terminal.go:24-29(the cleaning the reports apply)
Details
line := fmt.Sprintf(" %s %-8s %s (%s)", r.ID, r.Severity, r.Title, r.Location)
Titles can be model-written from target content, and locations hold target file names. On POSIX filesystems, file names can contain control bytes.
Impact
A scanned repository can put terminal control sequences into the operator's terminal output when they compare or list runs. This is display-only, but it breaks the guarantee the report path already gives.
Suggested fix
Export the existing cleaning helper (for example report.CleanText) and apply it to Title, Location and Target in runRunsCompare and to Target and Extra in printRunRow. JSON output needs no change.
Acceptance criteria
- Text output of
runsandruns comparecontains no C0 or C1 control characters from ledger content. - A test stores a finding whose title and location contain an ESC byte and checks the printed text.
Getting started
- Relevant files:
internal/cli/runs.go,internal/report/doc.go - How to run tests:
go test ./internal/cli ./internal/report
Related: #45
Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: bug|internal/cli/runs.go|runRunsCompare
- 主要语言
- Go
- 星标
- 0
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/Spackle 的其他 Issue
-
enhancement good first issue severity: low
难度 2/5 半天 新手友好度 72/100
TMHSDigital/Spackle#139 ·
-
enhancement good first issue severity: low
难度 2/5 1-3 小时 新手友好度 72/100
TMHSDigital/Spackle#138 ·
-
documentation good first issue severity: low
难度 2/5 1-3 小时 新手友好度 78/100
TMHSDigital/Spackle#135 ·
-
bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 72/100
TMHSDigital/Spackle#131 ·
-
bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 82/100
TMHSDigital/Spackle#128 ·
查看 TMHSDigital/Spackle 的全部 Issue
相似的 Issue
-
bug raised-by:reviewer
难度 2/5 1-3 小时 新手友好度 66/100
medici-finance/assay#7655 ·
维护者通常 1 天内回复
-
helm chart: make DaemonSet pod affinity configurable via values.yaml可能已有人在做 @Young-Zen 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
flannel-io/flannel#2632 ·
维护者通常 6 天内回复
-
go-vulnerability security-scan
难度 1/5 1 小时以内 新手友好度 72/100
teslashibe/agent-go#36 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
nwverse/persona#15194 · 1 条评论 ·
维护者通常 1 天内回复
-
bug flaky-test
难度 2/5 1-3 小时 新手友好度 78/100
rosskukulinski/tailworks#411 ·
维护者通常 1 天内回复