NewChecker takes CheckerOptions instead of positional arguments (closes #78)
check / check (push) Waiting to run
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user