aboutsummaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:43:23 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:43:23 +0200
commitc497d173b24b1b8247fac9e996e5c0fe690c1769 (patch)
tree2318ff1cf393e3a6c2a7d54c89e205ac6a9a5c73 /internal/config
parent360591d6e18d8676a2f86185ed42f46852387f85 (diff)
downloadkrino-c497d173b24b1b8247fac9e996e5c0fe690c1769.tar.gz
krino-c497d173b24b1b8247fac9e996e5c0fe690c1769.zip
plan 9: undo review matches review, --min-age validated, future mtimes, rule names, conflict enum, dependency gate, absolute tool paths
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/dir.go4
-rw-r--r--internal/config/dir_test.go1
2 files changed, 5 insertions, 0 deletions
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 {