Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Changing "Ignores" to "Ignored"
Browse files Browse the repository at this point in the history
  • Loading branch information
tro3 committed Apr 16, 2017
1 parent 7367dc9 commit 56e7772
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
15 changes: 8 additions & 7 deletions manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sort"

"bytes"

"github.com/pelletier/go-toml"
"github.com/pkg/errors"
"github.com/sdboyer/gps"
Expand All @@ -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"`
}

Expand Down Expand Up @@ -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,
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
8 changes: 4 additions & 4 deletions manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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")
}
}

Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
}

Expand Down
2 changes: 1 addition & 1 deletion testdata/manifest/error1.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ignores = ["github.com/foo/bar"]
ignored = ["github.com/foo/bar"]

[[dependencies]]
name = "github.com/sdboyer/gps"
Expand Down
2 changes: 1 addition & 1 deletion testdata/manifest/error2.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ignores = ["github.com/foo/bar"]
ignored = ["github.com/foo/bar"]

[[dependencies]]
name = "github.com/sdboyer/gps"
Expand Down
2 changes: 1 addition & 1 deletion testdata/manifest/golden.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ignores = ["github.com/foo/bar"]
ignored = ["github.com/foo/bar"]

[[dependencies]]
name = "github.com/babble/brook"
Expand Down

0 comments on commit 56e7772

Please sign in to comment.