--baseline with --files/--changed-since reports unlinted entries as stale

オープン 初心者向け
#106 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
cli, testing

調査の方向性

src/baseline.ts の applyBaseline 周辺と src/cli.ts の364~380行目あたりを読み、絞り込まれたファイルがどのように baseline の集計に渡されるかを追ってください。次に test/cli.test.ts を確認し、報告された --files の再現手順を実行してください。lint されていないファイルが古い項目数に含まれず、テストで古いエントリがゼロであることを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug good first issue severity: low

Summary

gdcorrect lint --baseline b.json --files ... (or --changed-since) counts every baseline entry for files that were not linted as "stale (fixed)", and tells the user they can be removed by rewriting the baseline.

Where

  • src/cli.ts:364-380
  • src/baseline.ts:101 (stale = every entry no finding consumed)

Details

applyBaseline has no idea the run was narrowed, so entries for unlinted files are never consumed. The stderr message then says "N baseline entries are stale (fixed) and can be removed by rewriting it", and staleBaselineEntries in the JSON is inflated by the same amount. --write-baseline with narrowing is (correctly) refused, so the message pushes users toward a full rewrite they do not need.

Impact

On pre-commit and PR runs, the main use of --changed-since, the stale count is misleading and grows with the size of the baseline.

Steps to reproduce

  1. Create a 3-file project with one finding per file and run gdcorrect lint p --write-baseline b.json.
  2. Run gdcorrect lint p --files p/a.gd --baseline b.json.
  3. stderr says "1 finding(s) matched the baseline; 2 baseline entries are stale (fixed)...".

Suggested fix

Pass the narrowed file set into applyBaseline, and count only stale entries whose file is in it.

Acceptance criteria

  • The repro reports 0 stale entries.
  • A test covers --baseline combined with --files.

Getting started

  • Relevant files: src/baseline.ts, src/cli.ts, test/cli.test.ts
  • How to run tests: npm run build && npm test

Filed by repo-audit/full-audit at e836036. Severity: low. Effort: S. audit-key: bug|src/cli.ts|baseline+narrowed

主要言語
TypeScript
スター
0
フォーク
6
平均マージ
1日 21時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/godot-correctness-mcp のほかの issue

TMHSDigital/godot-correctness-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。