refactor: centralize fingerprint method resolution in a Fingerprinter#2924
Open
vmaerten wants to merge 1 commit into
Open
refactor: centralize fingerprint method resolution in a Fingerprinter#2924vmaerten wants to merge 1 commit into
vmaerten wants to merge 1 commit into
Conversation
vmaerten
marked this pull request as ready for review
July 19, 2026 19:08
The decision "is this task up to date?" was spread over five call sites: the method-selection idiom (task method falling back to the Taskfile method) was copied verbatim in RunTask, Status and ToEditorOutput, and the sources checker was constructed separately in statusOnError and in compiledTask for the CHECKSUM/TIMESTAMP variable injection. Introduce a Fingerprinter in internal/fingerprint that owns method resolution and checker construction behind a small interface (UpToDate, OnError, Kind, SourceValue), and route all five call sites through it. It is built on the fly from the Executor's current state because exported fields like Dry may legitimately be mutated between runs. This also fixes the fingerprint variable ignoring a method set at the Taskfile level: compiledTask picked the checker from the task's own method only, so with a Taskfile-level "method: timestamp" the injected variable was computed by the checksum checker while the up-to-date check used timestamp. The variable now follows the same resolution as the up-to-date check, and is no longer injected when the effective method is "none".
vmaerten
force-pushed
the
refactor/fingerprinter
branch
from
July 19, 2026 19:09
2dcf108 to
95ec19f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IsTaskUpToDateis duplicated in multiple files. I've extracted in aFinderprinterstruct.It also fix an issue.
Before (main) timestamp would be empty
Now, it's fixed