report --finding ignores --out unless --format is also given
まだ誰も着手していません。
評価
調査の方向性
internal/cli/report.go の runReport(47〜61行目)から始めてください。ここでは、空の --format が --out の値に関係なく terminal に強制されています。その後、書き込みの流れを internal/cli/scan.go の emit(131〜166行目)まで追い、Output.Dir が参照される前に出力が標準出力へ描画される箇所を確認してください。修正方法は、--out も空の場合にのみ terminal をデフォルトにするか、--format を --out と一緒に指定するようユーザーに伝える明確な usage エラーを返すことです。internal/cli に、--out を指定し --format を指定しない --finding を対象とするテーブル駆動テストを追加し、go test ./internal/cli を実行してください。完了の条件は、選択された findings が出力ディレクトリに出力されること、またはコマンドが明確な usage エラーで終了することです。
索引モデルが issue の本文から書いたものです。
説明
Summary
spackle report <run> --finding <id> --out <dir> prints the report to the terminal, writes nothing to <dir>, and exits 0. With --finding, an empty --format always becomes terminal, even when --out was given. The code comment says a selection is "written under --out".
Where
internal/cli/report.go:47-61(runReport)internal/cli/scan.go:131-166(emitrenderstxtto stdout before it looks atOutput.Dir)
Details
// The stored reports hold every finding, so a selection is printed,
// or written under --out, and never pointed at the stored files.
if g.format == "" {
cfg.Output.Formats = []string{"terminal"}
}
Impact
A user or script that asks for a filtered report written to a directory gets no files and no error.
Steps to reproduce
spackle report latest --finding <id> --out ./r- The report prints to the terminal and
./rstays empty. Exit code 0.
Suggested fix
Default to terminal only when --out is also empty. Otherwise keep the configured formats and write them under --out, or refuse with "give --format with --out".
Acceptance criteria
-
report --finding <id> --out <dir>writes the selected findings to<dir>in the configured formats, or exits with a usage error that says what to add. - A test in
internal/clicovers--findingwith--outand no--format.
Getting started
- Relevant files:
internal/cli/report.go,internal/cli/scan.go - How to run tests:
go test ./internal/cli
Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: bug|internal/cli/report.go|runReport
- 主要言語
- Go
- スター
- 0
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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時間 初心者へのやさしさ 78/100
TMHSDigital/Spackle#129 ·
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 日以内に返信