diffx.Stat skips changed lines whose text starts with "++" or "--"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 87/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- backend, testing-qa
調査の方向性
internal/diffx/diffx.go の Stat 周辺と、issue に記載された diff 生成の動作を読みます。次に diffx のテストを実行し、削除された -- 行、追加された ++ 行、ファイルヘッダーのケースを追加します。Stat を更新し、ファイルヘッダーをスキップしながら、ハンク内の変更行を数えるようにします。受け入れ基準を満たし、make test-short が成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Stat treats every line starting with +++ or --- as a file header, so an added line whose text starts with ++ and a removed line whose text starts with -- are not counted. The 400-line limit on a model-written patch is computed from this count.
Where
internal/diffx/diffx.go:103-110(Stat)internal/agent/fixcheck.go:44,:194(added + removedagainstmaxPatchLines = 400)
Details
unified writes an added line as "+" + text and a removed one as "-" + text. An added ++i; becomes +++i;; a removed SQL, Lua or Haskell comment -- note, a YAML --- separator or a --flag \ continuation line becomes --- note. Both match the header case and are skipped.
Impact
The size of a fix is undercounted, so the patch size limit does not hold for such lines; a patch that removes or adds many of them can be far over the limit and still be accepted.
Steps to reproduce
- Call
diffx.Stat(diffx.Unified("a.sql", "-- one\n-- two\nSELECT 1;\n", "SELECT 1;\n")). - It returns
(0, 0); the diff removes two lines.
Suggested fix
Count by position, not by prefix alone: skip --- / +++ only for the two lines that follow a diff --git line (or its mode line) and precede the first @@; inside a hunk count every + and - line.
Acceptance criteria
-
Stat(Unified("a.sql", "-- one\n-- two\nSELECT 1;\n", "SELECT 1;\n"))returns 0 added, 2 removed - An added
++i;line counts as 1 added - File headers are still not counted
Getting started
- Relevant files: internal/agent/fixcheck.go, internal/diffx/diffx.go
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|internal/diffx/diffx.go|Stat
- 主要言語
- Go
- スター
- 0
- フォーク
- 1
- 平均マージ
- 8時間 14分
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TMHSDigital/Spackle のほかの issue
-
ci good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
TMHSDigital/Spackle#206 ·
メンテナーはふだん 1 日以内に返信
-
ci severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/Spackle#205 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/Spackle#199 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue severity: medium
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
TMHSDigital/Spackle#188 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue severity: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TMHSDigital/Spackle#187 ·
メンテナーはふだん 1 日以内に返信
TMHSDigital/Spackle の issue をすべて見る
似ている issue
-
bug effort:s impact:med raised-by:worker risk:low to:worker
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
medici-finance/assay#8120 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
agent-substrate/substrate#4308 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
celestiaorg/celestia-app#8877 ·
メンテナーはふだん 1 日以内に返信
-
sweep
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
bketelsen/truenas-mcp#112 ·
メンテナーはふだん 1 日以内に返信