From c497d173b24b1b8247fac9e996e5c0fe690c1769 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 21:43:23 +0200 Subject: plan 9: undo review matches review, --min-age validated, future mtimes, rule names, conflict enum, dependency gate, absolute tool paths --- internal/config/dir.go | 4 ++++ internal/config/dir_test.go | 1 + 2 files changed, 5 insertions(+) (limited to 'internal/config') diff --git a/internal/config/dir.go b/internal/config/dir.go index 461d912..54ee35e 100644 --- a/internal/config/dir.go +++ b/internal/config/dir.go @@ -184,6 +184,10 @@ func parseRule(n *sexp.Node, d *diags) *Rule { d.at(n, `rule needs a name in quotes first, like (rule "invoices" ...)`) return nil } + if strings.HasPrefix(args[0].Text, "(") { + d.at(n, `rule names cannot start with "(": (review) marks choices made in review`) + return nil + } r := &Rule{Name: args[0].Text, Pos: n.Pos} seen := map[string]*sexp.Node{} var whenNode *sexp.Node diff --git a/internal/config/dir_test.go b/internal/config/dir_test.go index 080905c..cae5f5f 100644 --- a/internal/config/dir_test.go +++ b/internal/config/dir_test.go @@ -112,6 +112,7 @@ func TestParseDirErrors(t *testing.T) { {`(path "/a") (rule "x" (delete) (move "y"))`, `d.conf:1:32: rule "x": (move "y") after delete would never run`}, {`(path "/a") (rule "x" (stop now))`, `d.conf:1:23: rule "x": stop takes nothing: write (stop)`}, {`(path "/a") (rule "x" (fly "y"))`, `d.conf:1:23: rule "x": unknown form (fly ...); a rule has when, copy, move, rename, delete, stop, case, fold and on-conflict`}, + {`(path "/a") (rule "(review)" (delete))`, `d.conf:1:13: rule names cannot start with "(": (review) marks choices made in review`}, {`(path "/a") (sort "x")`, `d.conf:1:13: unknown form (sort ...); a directory file has path, ignore, exclude, rule and settings like (recursive yes)`}, } for _, tt := range tests { -- cgit v1.3