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.go52
1 files changed, 26 insertions, 26 deletions
diff --git a/cmd/krino/render.go b/cmd/krino/render.go
index 5b75df3..ca7dad7 100644
--- a/cmd/krino/render.go
+++ b/cmd/krino/render.go
@@ -35,17 +35,17 @@ const minWrap = 10
// never wraps, which keeps a plan piped to a file one field per line.
func printPlan(w io.Writer, dp *engine.DirPlan, verbose bool, p palette, width int) {
r := dp.Result
- // C1 (plan 2): scanned counts matched, unmatched and skipped alike, not
- // just matched plus unmatched - spec §8.2's worked example is "266
- // scanned" against "41 to act on" and "not acted on: 3 busy · 12
- // ignored · 210 unmatched", and 41+3+12+210 = 266.
+ // scanned counts matched, unmatched and skipped alike, not just matched
+ // plus unmatched - spec §8.2's worked example is "266 scanned" against
+ // "41 to act on" and "not acted on: 3 busy · 12 ignored · 210
+ // unmatched", and 41+3+12+210 = 266.
scanned := len(r.Matched) + len(r.Unmatched) + len(r.Skipped)
- // B2: warning lines come from both the match itself (fm.Warnings) and
- // the chains plan.Build produced (Chain.Warnings, e.g. "moved more than
+ // warning lines come from both the match itself (fm.Warnings) and the
+ // chains plan.Build produced (Chain.Warnings, e.g. "moved more than
// once") - both computed once here so the count and the section below
// agree on the exact same list.
lines := collectWarnings(r, dp.Chains)
- // D12: dp.Elapsed spans Match plus Build, unlike r.Elapsed, which stops
+ // dp.Elapsed spans Match plus Build, unlike r.Elapsed, which stops
// before Build ever runs - the label says "planning", so the number
// must cover all of it.
counts := fmt.Sprintf("%d scanned · %d to act on · %d warnings · %.2fs", scanned, countActing(dp.Chains), warnedCount(lines), dp.Elapsed.Seconds())
@@ -131,14 +131,14 @@ func excludedLines(r *engine.Result, chains []plan.Chain) []string {
// 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.
+// actionableChains (sort.go) and chainOutcomes (sort.go) all share.
+// countActing and actionableChains used to each keep their own copy of
+// this question and disagree: 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 == "" {
@@ -149,9 +149,9 @@ func chainActing(c plan.Chain) bool {
}
// 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
-// to do anything either - neither must inflate "to act on".
+// actually run. A rule with no actions is an exclusion, and a chain every
+// one of whose steps is skipped is not about to do anything either -
+// neither must inflate "to act on".
func countActing(chains []plan.Chain) int {
n := 0
for _, c := range chains {
@@ -186,7 +186,7 @@ func printBlocks(w io.Writer, chains []plan.Chain, root string, p palette, width
fmt.Fprintln(w)
head := " " + padLeft(strconv.Itoa(i), numW) + " "
// A long name continues at the value column, never at the label
- // column, so its text cannot pass for a step line (triage 28l).
+ // column, so its text cannot pass for a step line.
for _, l := range wrapped(head, display(c.File.Rel), indent+labelWidth+1, width, plainText) {
fmt.Fprintln(w, l)
}
@@ -328,8 +328,8 @@ func wrapText(s string, max int) []string {
// character (CJK), none for a combining mark, one for the rest - format
// characters included: a terminal may draw one (a soft hyphen), and
// counting a column too many only wraps early, while one too few runs past
-// the edge (triage 28j, plan 11 review L4). A terminal can still draw some
-// characters wider (emoji, ambiguous-width letters); see KNOWN LIMITATIONS.
+// the edge. A terminal can still draw some characters wider (emoji,
+// ambiguous-width letters); see KNOWN LIMITATIONS.
func cols(s string) int {
n := 0
for _, r := range s {
@@ -362,9 +362,9 @@ func destText(s plan.Step, root string) string {
dir := filepath.Dir(s.Dst)
if rel, ok := relToRoot(root, dir); ok {
if rel == "" {
- // D10: rel is "" exactly when dir is root itself (relToRoot's
- // own case below); rendering that as bare rel+"/" would print
- // "/", which reads as the filesystem root rather than "this
+ // rel is "" exactly when dir is root itself (relToRoot's own
+ // case below); rendering that as bare rel+"/" would print "/",
+ // which reads as the filesystem root rather than "this
// directory".
return "./"
}
@@ -376,7 +376,7 @@ func destText(s plan.Step, root string) string {
// relToRoot returns dir relative to root (slash-separated) when dir is
// root itself or lies inside it; ok is false when dir lies outside root,
// including when the two cannot be related at all (e.g. one relative, one
-// absolute). C3: root itself counts as "inside" here (rel is "", ok true) -
+// absolute). root itself counts as "inside" here (rel is "", ok true) -
// unlike internal/engine/match.go's excludeDirs, which asks a different
// question (what may a rule exclude from the walk) and treats root as
// outside it; do not "unify" the two.
@@ -405,7 +405,7 @@ func padLeft(s string, w int) string {
// colWidth returns the widest string in ss, in runes, capped at max when
// max is positive; 0 leaves it uncapped. Shares relWidth's rune-counting
-// rule (C4): a name carrying diacritics must not misalign its column.
+// rule: a name carrying diacritics must not misalign its column.
func colWidth(ss []string, max int) int {
w := 0
for _, s := range ss {