aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/matching_test.go
Commit message (Collapse)AuthorAgeFilesLines
* the directory lock is the kernel's, not a pid we believeLukasz Kasprzak2 days1-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | flock(2) on the lock file's descriptor replaces "write my pid, and decide whether the pid in the file is still alive". The kernel drops the lock when the process ends, however it ends, so there is no stale krino lock to detect and no takeover to race over. What that fixes: - Two runs that both judged a lock stale could remove and recreate it and both believe they held it. Remove-then-create cannot be made atomic; there is nothing to make atomic now. Pinned by a test with eight callers over twenty rounds. - A pid reused after a crash made the lock live for ever, and the message named neither the file nor the pid, so there was nothing to act on. The message now names both. - Signal(0) reads EPERM as "not running", so a lock held by another user was taken over. There is no such judgement left to get wrong. A run that waits for a held lock now says so first. Waiting is what the spec asks for, but the wait has no timeout, and in silence it is indistinguishable from a hang - I spent two minutes on one myself today, waiting on a lock the window was holding. Tests that faked a held lock by writing a file now hold a real one.
* comments that explain the code, not how it was writtenLukasz Kasprzak2 days1-24/+23
| | | | | | | | | | | | | | | | | | About 340 comments cited the development process: task and plan numbers, fix waves, rulings, reviewers, and the author in the third person with a date. None of that exists outside the work itself, so to a reader it pointed at nothing. Each one now states the engineering reason it was standing in front of; where a comment was provenance and nothing else, it is gone. References to docs/design.md and docs/gui-design.md by section stay: both ship with the repository. The design documents lose their amendment diaries - CHANGELOG.md is that record - and the GUI's says plainly that the window has gone further than the document. Only comments changed. Every .go file was parsed and its code printed with comments stripped, before and after: the two hashes are identical across all 175 files.
* --json carries exclusions and matching warningsLukasz Kasprzak5 days1-0/+49
|
* krino: 0.0.3 — the plan as one block per file, wrapped, and -Pv0.0.3Lukasz Kasprzak5 days1-8/+12
| | | | | | | | Each file shows its steps, then the rule and the reason it matched, one field per line; on a terminal every line wraps to its width with continuation lines under their own column, and piped output is never wrapped. Choosing per file shows the same block. -P / --no-pager prints the plan without the pager. A duplicate's original is shown with ~.
* krino: duplicates are found, never deletedLukasz Kasprzak5 days1-2/+2
| | | | | | | | | A rule combining (duplicate) with a delete action is refused at load, and a file that is a duplicate under any duplicate scope its directory uses gets no delete step from any rule: the plan shows it skipped and the chain continues. A failed duplicate check blocks the delete too. Tests cover (matched), another rule's own condition, a test evaluation skipped, two scopes and a failed check, each checking every copy is still on disk.
* krino: acting — trash, journal, apply, lock, review, undoLukasz Kasprzak7 days1-2/+97
|
* krino: planning — chains, placeholders, conflicts, JSONLukasz Kasprzak7 days1-11/+39
|
* krino: matching — scan, ignore, conditions, extraction, duplicates, ↵Lukasz Kasprzak8 days1-0/+374
explain, dry run