NewChecker takes CheckerOptions instead of positional arguments (closes #78)
check / check (push) Waiting to run

NewChecker now takes *CheckerOptions (ManifestPath, BasePath, Fs), named
like ScannerOptions. A nil Fs still means the OS filesystem, as before and
as in ScannerOptions; nil options or an empty path return an error naming
the missing path.

Audit of the other exported constructors in mfer: NewManifestFromFile took
a filesystem and a path positionally; it now takes
*ManifestFromFileOptions (Path, Fs) with the same nil and empty rules.
NewBuilder and NewScanner take no arguments, NewScannerWithOptions already
takes options, and NewManifestFromReader takes one reader, which the style
guide exempts; these are unchanged.

Model: opus-5-5
This commit was merged in pull request #137.
This commit is contained in:
2026-10-04 12:19:31 +02:00
parent 76116005c8
commit 0a9963002c
9 changed files with 301 additions and 66 deletions
+8 -2
View File
@@ -58,7 +58,10 @@ func TestFreshenUnchanged(t *testing.T) {
setupFreshenDir(t, fs)
// Parse manifest to verify
manifest, err := mfer.NewManifestFromFile(fs, "/testdir/.index.mf")
manifest, err := mfer.NewManifestFromFile(&mfer.ManifestFromFileOptions{
Path: "/testdir/.index.mf",
Fs: fs,
})
require.NoError(t, err)
assert.Len(t, manifest.Files(), 2)
}
@@ -70,7 +73,10 @@ func TestFreshenWithChanges(t *testing.T) {
setupFreshenDir(t, fs)
// Verify initial manifest has 2 files
manifest, err := mfer.NewManifestFromFile(fs, "/testdir/.index.mf")
manifest, err := mfer.NewManifestFromFile(&mfer.ManifestFromFileOptions{
Path: "/testdir/.index.mf",
Fs: fs,
})
require.NoError(t, err)
assert.Len(t, manifest.Files(), 2)