Diff scans filter by whole file, so touching one line reports every old lead in it
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
Start with keepChanged in internal/engine/diffscan.go:59-72, which today filters leads by changed[l.File], and with the --name-only listing in internal/gitx/gitx.go:312-329 that produces that set. Add a --diff-scope file|lines flag plus the diff-scope Action input in action.yml, and put the git diff -U0 hunk parser in a new internal/diffx/ package, keeping dependency leads on the existing lockfile rule. Done when the new engine and gitx tests pass via go test ./internal/engine ./internal/gitx, hunk parsing is covered for deletions, renames and CRLF, and docs/ci.md:135-139 documents the flag and the note counting leads outside changed lines.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Diff scans (--since, --changed, the Action's diff-base) keep a lead when its file changed. Touching one line of a large legacy file therefore reports, and can fail CI on, every pre-existing lead in that file. A line-level scope would fix the common case without a baseline file.
Where
internal/engine/diffscan.go:59-72(keepChanged)internal/gitx/gitx.go:312-329(--name-onlylisting: no line information)docs/ci.md:135-139
Details
for _, l := range leads {
if changed[l.File] {
kept = append(kept, l)
}
}
Impact
In a PR gate, a one-line typo fix in an old file fails CI on every lead already in it. That is the adoption blocker #81 describes, and the common case can be fixed without a baseline file.
Steps to reproduce
app.pyhas an old SQL-injection lead at line 40.- On a branch, change a comment on line 300.
spackle scan . --since main --fail-on highexits 1 on the line-40 lead.
Suggested fix
Add --diff-scope file|lines (Action input diff-scope), defaulting to file to keep today's behavior. lines runs git diff -U0 --no-textconv --no-ext-diff <spec>, parses the @@ -a,b +c,d @@ hunks into changed line ranges per file, and keeps a lead whose [StartLine, EndLine] overlaps one. Dependency leads keep today's lockfile rule. The run note should say how many leads in changed files fell outside the changed lines. This complements #81 (baseline) and #96 (line-stable fingerprint) and does not replace them.
Acceptance criteria
- With
--diff-scope lines, a lead outside the changed hunks of a changed file is not reported, and the note counts it. - A lead overlapping an added or modified line is reported.
- Hunk parsing is unit tested, including pure deletions, renames and CRLF files.
Getting started
- Relevant files:
internal/engine/diffscan.go,internal/gitx/gitx.go,internal/diffx/,action.yml,docs/ci.md - How to run tests:
go test ./internal/engine ./internal/gitx
Related: #81, #96
Filed by repo-audit/full-audit at fffef43. Severity: medium. Effort: M. audit-key: enhancement|internal/engine/diffscan.go|keepChanged
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/Spackle
-
enhancement good first issue severity: low
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
TMHSDigital/Spackle#139 ·
-
enhancement good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TMHSDigital/Spackle#138 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Spackle#135 ·
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TMHSDigital/Spackle#131 ·
-
runs and runs compare print target text without the control-character cleaning the reports useĐang mởbug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Spackle#129 ·
Tất cả issue của TMHSDigital/Spackle
Issue tương tự
-
bug raised-by:reviewer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
medici-finance/assay#7655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
helm chart: make DaemonSet pod affinity configurable via values.yamlCó thể đã có người làm @Young-Zen đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
flannel-io/flannel#2632 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
go-vulnerability security-scan
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
teslashibe/agent-go#36 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nwverse/persona#15194 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug flaky-test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rosskukulinski/tailworks#411 ·
Maintainer thường phản hồi trong vòng 1 ngày