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

Offen
#132 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
70/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
go
Bereich
cli

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Go
Sterne
0
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/Spackle

Alle Issues in TMHSDigital/Spackle

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.