diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 15:16:55 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 15:16:55 +0200 |
| commit | 0b5d0eb92c5be2f0ddb2fa73990f31e5654e57fe (patch) | |
| tree | 358e331945b8206ed4a72703e3aedfe8ea7cdcdb /cmd/krino/sort.go | |
| parent | 1d3f2d1e4c59867024470d3444e12698b7ebb22e (diff) | |
| download | krino-0b5d0eb92c5be2f0ddb2fa73990f31e5654e57fe.tar.gz krino-0b5d0eb92c5be2f0ddb2fa73990f31e5654e57fe.zip | |
krino: 0.0.5 — keyword cache, t and d in reviewv0.0.5
Diffstat (limited to 'cmd/krino/sort.go')
| -rw-r--r-- | cmd/krino/sort.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/krino/sort.go b/cmd/krino/sort.go index 9e714ba..3e5d951 100644 --- a/cmd/krino/sort.go +++ b/cmd/krino/sort.go @@ -69,6 +69,7 @@ func cmdSort(g *globals, names []string, stdout, stderr io.Writer) int { if setMinAge { applyMinAge(e, minAge) } + e.CacheDir = cacheDir() p := palette{on: colourOn(g, stdout)} // Spec §8.4: with neither -y nor -n, krino asks; asking a non-terminal @@ -213,12 +214,13 @@ func cmdSort(g *globals, names []string, stdout, stderr io.Writer) int { } var approved map[string]bool + var replaced map[string]plan.Kind var action rune if g.yes { approved, action = approveAll(actionable), 'a' } else { var rerr error - approved, action, rerr = reviewDir(stdout, actionable, d.Root, p) + approved, replaced, action, rerr = reviewDir(stdout, actionable, d.Root, p) if rerr != nil { fmt.Fprintf(stderr, "krino: %s: %v\n", d.Name, rerr) exit = 1 @@ -242,6 +244,9 @@ func cmdSort(g *globals, names []string, stdout, stderr io.Writer) int { return true } + // [t] and [d] in review: the file gets the one step chosen + // there instead of the chain its rules planned. + dp.Chains = replaceChains(dp.Chains, replaced) res, aerr := e.Apply(ctx, dp, approved, j, run) if aerr != nil { if errors.Is(aerr, context.Canceled) || errors.Is(aerr, context.DeadlineExceeded) { |
