From 1506c7dcd6032c04c1df6f5785b6dd3dfe4511cc Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 10:56:21 +0200 Subject: krino: duplicates are found, never deleted A rule combining (duplicate) with a delete action is refused at load, and a file that is a duplicate under any duplicate scope its directory uses gets no delete step from any rule: the plan shows it skipped and the chain continues. A failed duplicate check blocks the delete too. Tests cover (matched), another rule's own condition, a test evaluation skipped, two scopes and a failed check, each checking every copy is still on disk. --- cmd/krino/matching_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/krino/matching_test.go') diff --git a/cmd/krino/matching_test.go b/cmd/krino/matching_test.go index 69c0eca..25a2993 100644 --- a/cmd/krino/matching_test.go +++ b/cmd/krino/matching_test.go @@ -18,7 +18,7 @@ const dlRules = ` (recursive yes) (min-age 0s) (ignore "*.part") -(rule "dups" (when (duplicate)) (delete) (stop)) +(rule "dups" (when (duplicate)) (move "Dupes") (stop)) (rule "acme" (when (type document) (content "acme ltd")) (move "Work/Acme") (stop)) (rule "images" (when (type image)) (move "Pictures")) (rule "rest" (when (not (matched)) (type text)) (move "Other")) @@ -66,7 +66,7 @@ func TestDryRun(t *testing.T) { "krino: dl ~/dl\n8 scanned · 4 to act on · 2 warnings · ", "\n 1 inv1.txt move → Work/Acme/ acme type txt, content \"acme ltd\"\n", "\n 2 notes.txt move → Other/ rest not matched, type txt\n", - "\n 4 report (1).pdf trash dups duplicate of report.pdf\n", + "\n 4 report (1).pdf move → Dupes/ dups duplicate of report.pdf\n", "\nwarnings\n brochure.doc acme: content unreadable: needs antiword or catdoc, not installed\n", "\nnot acted on: 1 ignored · 1 busy · 2 unmatched (-v lists them)\n", } { -- cgit v1.3