Say "skipped" in scan's warnings for skipped paths (closes #170) #195

Merged
clawbot merged 1 commits from issue-170-scan-skipped-wording into next 2026-11-11 13:37:14 +01:00
Collaborator

Fixes #170.

  • Every warning for a path the summary counts as skipped now reads scan: skipped PATH (REASON), path named once. This covers unreadable directories, failed lstats, failed reads and dropped operands ((a FIFO), (inside a .zfs directory)). One helper, skippedLine in scan.go, builds the read and lstat lines. It strips the path from the error and keeps the underlying reason.
  • Lines for paths left out on purpose now read scan: left out PATH (...): --exclude, default excludes, and filesystems that are not persistent.
  • README.md: "What scan prints" gives the wording; the three example lines under "Rules for the walk" changed to match. The issue says two, but there were three.

Judgement call: a file with several hard links that cannot be read used to get one warning naming the first path, while the summary counted every path. Each path now gets its own line, so a search for scan: skipped finds every counted path. Reversing it means restoring the single warning and the README sentence about hard links.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/sfdupes/issues/170. - Every warning for a path the summary counts as skipped now reads `scan: skipped PATH (REASON)`, path named once. This covers unreadable directories, failed lstats, failed reads and dropped operands (`(a FIFO)`, `(inside a .zfs directory)`). One helper, `skippedLine` in `scan.go`, builds the read and lstat lines. It strips the path from the error and keeps the underlying reason. - Lines for paths left out on purpose now read `scan: left out PATH (...)`: `--exclude`, default excludes, and filesystems that are not persistent. - `README.md`: "What `scan` prints" gives the wording; the three example lines under "Rules for the walk" changed to match. The issue says two, but there were three. Judgement call: a file with several hard links that cannot be read used to get one warning naming the first path, while the summary counted every path. Each path now gets its own line, so a search for `scan: skipped` finds every counted path. Reversing it means restoring the single warning and the README sentence about hard links. Model: opus-5-5
clawbot added the needs-review label 2026-11-11 10:26:15 +01:00
clawbot self-assigned this 2026-11-11 10:26:17 +01:00
Author
Collaborator

Verdict: FAIL
Head: 6cfeb4ab65

  1. internal/sfdupes/scan.go, subdirJob (the skippedLine(p, err) warning after e.Info() fails): no test checks this warning. It is one of the four places changed to print scan: skipped PATH (REASON), and the only one with no test. A subdirectory that cannot be statted gets this line, for example one inside a directory that can be read but not searched. Acceptable: in TestScanWarnsAboutUnreadablePaths in internal/sfdupes/scan_test.go, create a subdirectory inside the walked unsearchable directory before the chmod, expect 4 skipped instead of 3, and expect a scan: skipped line naming that subdirectory with (permission denied).

Model: opus-5-5

Verdict: FAIL Head: 6cfeb4ab65c05db0512bb25342d29c40651a72ab 1. `internal/sfdupes/scan.go`, `subdirJob` (the `skippedLine(p, err)` warning after `e.Info()` fails): no test checks this warning. It is one of the four places changed to print `scan: skipped PATH (REASON)`, and the only one with no test. A subdirectory that cannot be statted gets this line, for example one inside a directory that can be read but not searched. Acceptable: in `TestScanWarnsAboutUnreadablePaths` in `internal/sfdupes/scan_test.go`, create a subdirectory inside the walked `unsearchable` directory before the chmod, expect 4 skipped instead of 3, and expect a `scan: skipped` line naming that subdirectory with `(permission denied)`. Model: opus-5-5
clawbot force-pushed issue-170-scan-skipped-wording from 6cfeb4ab65 to a179fbaa9c 2026-11-11 11:55:35 +01:00 Compare
Author
Collaborator
  1. Done as suggested, in a179fba; the subdirectory is tree/unsearchable/d.

Model: opus-5-5

1. Done as suggested, in `a179fba`; the subdirectory is `tree/unsearchable/d`. Model: opus-5-5
Author
Collaborator

Verdict: FAIL
Head: a179fbaa9c

  1. README.md, section "What scan prints", in the paragraph after the two example scan: skipped lines: the sentence "When a file with several hard links cannot be read, each of its paths gets a warning." puts a rare case in front of the main rule that follows it, "A line for a path left out on purpose starts with scan: left out instead, and is not counted." The "instead" then reads as if it contrasts with the hard-link warning, not with the skipped-path warning it is meant to contrast with. Acceptable: move the hard-link sentence to the end of the paragraph, after "A search of the log for scan: skipped therefore finds the paths the summary counts."

Model: opus-5-5

Verdict: FAIL Head: a179fbaa9c74e78a543d4aa6d1a7df8b32ae6725 1. `README.md`, section "What `scan` prints", in the paragraph after the two example `scan: skipped` lines: the sentence "When a file with several hard links cannot be read, each of its paths gets a warning." puts a rare case in front of the main rule that follows it, "A line for a path left out on purpose starts with `scan: left out` instead, and is not counted." The "instead" then reads as if it contrasts with the hard-link warning, not with the skipped-path warning it is meant to contrast with. Acceptable: move the hard-link sentence to the end of the paragraph, after "A search of the log for `scan: skipped` therefore finds the paths the summary counts." Model: opus-5-5
Author
Collaborator

For the reworker (third failed review; this ends the loop): fix exactly the findings of the newest review as its "Acceptable" lines say, nothing else. The next review checks only those.

Model: opus-5-5

For the reworker (third failed review; this ends the loop): fix exactly the findings of the newest review as its "Acceptable" lines say, nothing else. The next review checks only those. Model: opus-5-5
clawbot added 1 commit 2026-11-11 13:09:24 +01:00
A warning for a path the summary counts as skipped now reads
`scan: skipped PATH (REASON)`, naming the path once. This covers
unreadable directories, failed lstats, failed reads and dropped
operands. Each path of a hard-linked file that cannot be read gets its
own line, since each is counted. Lines for paths left out on purpose
(`--exclude`, default excludes, filesystems that are not persistent)
now read `scan: left out PATH (...)`, so a search for `scan: skipped`
finds only the counted paths.

Model: opus-5-5
clawbot force-pushed issue-170-scan-skipped-wording from a179fbaa9c to 4dba676880 2026-11-11 13:09:24 +01:00 Compare
Author
Collaborator
  1. Done as suggested, in 4dba676.

Model: opus-5-5

1. Done as suggested, in `4dba676`. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 4dba676880

Every path the summary counts as skipped now gets one scan: skipped PATH (REASON) line, paths left out on purpose get scan: left out, and the README matches the code.

Model: opus-5-5

Verdict: PASS Head: 4dba676880fa9730f656d30d9b1c13a6dd73e7d1 Every path the summary counts as skipped now gets one `scan: skipped PATH (REASON)` line, paths left out on purpose get `scan: left out`, and the README matches the code. Model: opus-5-5
clawbot merged commit e16c46804d into next 2026-11-11 13:37:14 +01:00
Sign in to join this conversation.