NewChecker takes CheckerOptions instead of positional arguments (closes #78)
check / check (push) Failing after 1s
check / check (push) Failing after 1s
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:
@@ -504,7 +504,10 @@ func TestGenerateExcludesDotfilesByDefault(t *testing.T) {
|
||||
assert.True(t, exists)
|
||||
|
||||
// Verify manifest only has 1 file (the non-dotfile)
|
||||
manifest, err := mfer.NewManifestFromFile(fs, testMF)
|
||||
manifest, err := mfer.NewManifestFromFile(&mfer.ManifestFromFileOptions{
|
||||
Path: testMF,
|
||||
Fs: fs,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, manifest.Files(), 1)
|
||||
assert.Equal(t, "file1.txt", manifest.Files()[0].GetPath())
|
||||
@@ -528,7 +531,10 @@ func TestGenerateWithIncludeDotfiles(t *testing.T) {
|
||||
require.Equal(t, 0, exitCode)
|
||||
|
||||
// Verify manifest has 2 files (including dotfile)
|
||||
manifest, err := mfer.NewManifestFromFile(fs, testMF)
|
||||
manifest, err := mfer.NewManifestFromFile(&mfer.ManifestFromFileOptions{
|
||||
Path: testMF,
|
||||
Fs: fs,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, manifest.Files(), 2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user