From 058ea2ceb859fa3797745c8ae8ff0df9d86e0a2a Mon Sep 17 00:00:00 2001 From: protolambda Date: Thu, 23 May 2024 13:29:10 +0200 Subject: [PATCH] rename new 'ignored' field to 'ignore' for consistency with previous ignore option --- README.md | 3 +++ main.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7c61c6..36bea64 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,9 @@ def: description: "The `printer` package prints greetings" globs: - "hello/printer/*" + - "hello/printer/display/**" # double start glob patterns work too, for recursive matching! + ignore: + - "hello/printer/testdata/**" # to group test-data with the package, but ignore the lines, use "ignore" - title: "MOTD" description: "New package that generates a message of the day (MOTD) to add to the greeting" globs: diff --git a/main.go b/main.go index 282fffe..9c70241 100644 --- a/main.go +++ b/main.go @@ -296,7 +296,7 @@ type ForkDefinition struct { Description string `yaml:"description,omitempty"` Globs []string `yaml:"globs,omitempty"` Sub []*ForkDefinition `yaml:"sub,omitempty"` - Ignored []string `yaml:"ignored,omitempty"` + Ignore []string `yaml:"ignore,omitempty"` Files []FilePatchStats `yaml:"-"` LinesAdded int `yaml:"-"` @@ -333,7 +333,7 @@ func (fd *ForkDefinition) hydrate(patchByName map[string]diff.FilePatch, remaini fmt.Printf("cannot find patch %q\n", name) continue } - for _, globPattern := range fd.Ignored { + for _, globPattern := range fd.Ignore { if ok, err := doublestar.Match(globPattern, name); err != nil { return fmt.Errorf("failed to glob match ignored-entry %q against pattern %q", name, globPattern) } else if ok {