aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/render.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/krino/render.go')
-rw-r--r--cmd/krino/render.go26
1 files changed, 21 insertions, 5 deletions
diff --git a/cmd/krino/render.go b/cmd/krino/render.go
index b27d4d1..de5489a 100644
--- a/cmd/krino/render.go
+++ b/cmd/krino/render.go
@@ -77,6 +77,25 @@ func printPlan(w io.Writer, dp *engine.DirPlan, verbose bool) {
}
}
+// chainActing reports whether c has at least one step that will actually
+// run - the single definition of "actionable" that countActing,
+// actionableChains (sort.go) and chainOutcomes (sort.go) all share (fix
+// wave item 4 / Minor 5). Before this fix, countActing and actionableChains
+// each kept their own copy of this question and disagreed: countActing
+// excluded an all-skipped chain (len(Steps) > 0, but every step's Skip is
+// set) while actionableChains's own len(Steps) > 0 check included it, so a
+// directory could print "N scanned ยท 0 to act on" and then still ask the
+// user to approve a file it had just said there were none of - and on
+// approval, log a run-start/run-end pair holding only "skipped" entries.
+func chainActing(c plan.Chain) bool {
+ for _, s := range c.Steps {
+ if s.Skip == "" {
+ return true
+ }
+ }
+ return false
+}
+
// countActing reports how many chains have at least one step that will
// actually run. C1/ruling 2026-09-12: a rule with no actions is an
// exclusion, and a chain every one of whose steps is skipped is not about
@@ -84,11 +103,8 @@ func printPlan(w io.Writer, dp *engine.DirPlan, verbose bool) {
func countActing(chains []plan.Chain) int {
n := 0
for _, c := range chains {
- for _, s := range c.Steps {
- if s.Skip == "" {
- n++
- break
- }
+ if chainActing(c) {
+ n++
}
}
return n