spackle bench lists and accepts flags it ignores, and passes --pr into corpus scans

未關閉
#132 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
70/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
cli

研究方向

Start in internal/cli/bench.go where g.register(fs) registers the full shared flag set, then compare it with the flag groups in internal/cli/flags.go. Check internal/bench/run.go to see which config fields it reads, and confirm that cfg.Fix.PR reaches engine.Run. Done means spackle bench --help lists only the flags bench reads, unknown flags are rejected, bench never opens a pull request, and docs/config.md matches. Run go test ./internal/cli ./internal/bench to check.

由索引模型根據 Issue 內容生成。

描述

documentation good first issue severity: low

Summary

spackle bench registers the full shared flag set, so its help lists, and it accepts, --authorize, --fail-on, --fail-on-confidence and --format, none of which it reads. --pr is passed through into every corpus fixture scan. docs/config.md:106 says "scan and bench take all of them", and the CHANGELOG says commands "now accept only the flags they read".

Where

  • internal/cli/bench.go:29-30 (g.register(fs))
  • internal/cli/bench.go:139 (returns ExitOK without checking fail_on)
  • internal/bench/run.go:100-110 (touches only cfg.Output.Dir; cfg.Fix.PR reaches engine.Run)
  • docs/config.md:106, CHANGELOG.md:46

Impact

Low, because bench is a maintainer command hidden from the main help. Still, spackle bench --fail-on high looks like a CI gate and always exits 0, --format does nothing, and --pr (or [fix] pr = true in a config) sends "push the fix branch and open a pull request" into scans of the corpus fixtures.

Steps to reproduce

  1. spackle bench --help lists --fail-on-confidence.
  2. spackle bench --fail-on low --format json exits 0 and prints the plain-text summary.

Suggested fix

Register only the groups bench reads, for example g.registerGroups(fs, flagsConfig|flagsModel|flagsBudget|flagsOffline|flagsOutput|flagsYes|flagsExclude), keeping --out for the results directory. Force cfg.Fix.PR = false in bench.Run. List bench's flags separately in docs/config.md:106.

Acceptance criteria

  • spackle bench --help lists only flags bench reads, and the others are rejected as unknown.
  • Bench never opens a pull request, whatever the config says.
  • docs/config.md lists bench's flags accurately.

Getting started

  • Relevant files: internal/cli/bench.go, internal/cli/flags.go, internal/bench/run.go, docs/config.md
  • How to run tests: go test ./internal/cli ./internal/bench

Related: #47 (narrowed the flags of report, verify, doctor and debug)


Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: documentation|internal/cli/bench.go|runBench-flags

主要語言
Go
星號
0
分支
1
PR 合併指標
30 天內沒有已合併 PR

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Spackle 的其他 Issue

查看 TMHSDigital/Spackle 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。