From 56e7772f23329ace072a5c50efa883145389453c Mon Sep 17 00:00:00 2001 From: tro3 Date: Sat, 15 Apr 2017 20:22:59 -0700 Subject: [PATCH] Changing "Ignores" to "Ignored" --- manifest.go | 15 ++++++++------- manifest_test.go | 8 ++++---- project_test.go | 2 +- testdata/manifest/error1.toml | 2 +- testdata/manifest/error2.toml | 2 +- testdata/manifest/golden.toml | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/manifest.go b/manifest.go index b6187c58..db35aa5b 100644 --- a/manifest.go +++ b/manifest.go @@ -9,6 +9,7 @@ import ( "sort" "bytes" + "github.com/pelletier/go-toml" "github.com/pkg/errors" "github.com/sdboyer/gps" @@ -19,14 +20,14 @@ const ManifestName = "Gopkg.toml" type Manifest struct { Dependencies gps.ProjectConstraints Ovr gps.ProjectConstraints - Ignores []string + Ignored []string Required []string } type rawManifest struct { Dependencies []rawProject `toml:"dependencies,omitempty"` Overrides []rawProject `toml:"overrides,omitempty"` - Ignores []string `toml:"ignores,omitempty"` + Ignored []string `toml:"ignored,omitempty"` Required []string `toml:"required,omitempty"` } @@ -58,7 +59,7 @@ func fromRawManifest(raw rawManifest) (*Manifest, error) { m := &Manifest{ Dependencies: make(gps.ProjectConstraints, len(raw.Dependencies)), Ovr: make(gps.ProjectConstraints, len(raw.Overrides)), - Ignores: raw.Ignores, + Ignored: raw.Ignored, Required: raw.Required, } @@ -123,7 +124,7 @@ func (m *Manifest) toRaw() rawManifest { raw := rawManifest{ Dependencies: make([]rawProject, 0, len(m.Dependencies)), Overrides: make([]rawProject, 0, len(m.Ovr)), - Ignores: m.Ignores, + Ignored: m.Ignored, Required: m.Required, } for n, prj := range m.Dependencies { @@ -206,12 +207,12 @@ func (m *Manifest) Overrides() gps.ProjectConstraints { } func (m *Manifest) IgnoredPackages() map[string]bool { - if len(m.Ignores) == 0 { + if len(m.Ignored) == 0 { return nil } - mp := make(map[string]bool, len(m.Ignores)) - for _, i := range m.Ignores { + mp := make(map[string]bool, len(m.Ignored)) + for _, i := range m.Ignored { mp[i] = true } diff --git a/manifest_test.go b/manifest_test.go index 04726d30..27200316 100644 --- a/manifest_test.go +++ b/manifest_test.go @@ -40,7 +40,7 @@ func TestReadManifest(t *testing.T) { Constraint: gps.NewBranch("master"), }, }, - Ignores: []string{"github.com/foo/bar"}, + Ignored: []string{"github.com/foo/bar"}, } if !reflect.DeepEqual(got.Dependencies, want.Dependencies) { @@ -49,8 +49,8 @@ func TestReadManifest(t *testing.T) { if !reflect.DeepEqual(got.Ovr, want.Ovr) { t.Error("Valid manifest's overrides did not parse as expected") } - if !reflect.DeepEqual(got.Ignores, want.Ignores) { - t.Error("Valid manifest's ignores did not parse as expected") + if !reflect.DeepEqual(got.Ignored, want.Ignored) { + t.Error("Valid manifest's ignored did not parse as expected") } } @@ -76,7 +76,7 @@ func TestWriteManifest(t *testing.T) { Constraint: gps.NewBranch("master"), }, }, - Ignores: []string{"github.com/foo/bar"}, + Ignored: []string{"github.com/foo/bar"}, } got, err := m.MarshalTOML() diff --git a/project_test.go b/project_test.go index a346c293..29ed86f8 100644 --- a/project_test.go +++ b/project_test.go @@ -65,7 +65,7 @@ func TestProjectMakeParams(t *testing.T) { p := Project{ AbsRoot: "someroot", ImportRoot: gps.ProjectRoot("Some project root"), - Manifest: &Manifest{Ignores: []string{"ignoring this"}}, + Manifest: &Manifest{Ignored: []string{"ignoring this"}}, Lock: &Lock{}, } diff --git a/testdata/manifest/error1.toml b/testdata/manifest/error1.toml index 136beec0..27fd8813 100644 --- a/testdata/manifest/error1.toml +++ b/testdata/manifest/error1.toml @@ -1,4 +1,4 @@ -ignores = ["github.com/foo/bar"] +ignored = ["github.com/foo/bar"] [[dependencies]] name = "github.com/sdboyer/gps" diff --git a/testdata/manifest/error2.toml b/testdata/manifest/error2.toml index c2927662..35fe7a94 100644 --- a/testdata/manifest/error2.toml +++ b/testdata/manifest/error2.toml @@ -1,4 +1,4 @@ -ignores = ["github.com/foo/bar"] +ignored = ["github.com/foo/bar"] [[dependencies]] name = "github.com/sdboyer/gps" diff --git a/testdata/manifest/golden.toml b/testdata/manifest/golden.toml index 7de52e50..7119904a 100644 --- a/testdata/manifest/golden.toml +++ b/testdata/manifest/golden.toml @@ -1,4 +1,4 @@ -ignores = ["github.com/foo/bar"] +ignored = ["github.com/foo/bar"] [[dependencies]] name = "github.com/babble/brook"