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

Commit 56e7772

Browse files
author
tro3
committed
Changing "Ignores" to "Ignored"
1 parent 7367dc9 commit 56e7772

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

manifest.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"sort"
1010

1111
"bytes"
12+
1213
"github.com/pelletier/go-toml"
1314
"github.com/pkg/errors"
1415
"github.com/sdboyer/gps"
@@ -19,14 +20,14 @@ const ManifestName = "Gopkg.toml"
1920
type Manifest struct {
2021
Dependencies gps.ProjectConstraints
2122
Ovr gps.ProjectConstraints
22-
Ignores []string
23+
Ignored []string
2324
Required []string
2425
}
2526

2627
type rawManifest struct {
2728
Dependencies []rawProject `toml:"dependencies,omitempty"`
2829
Overrides []rawProject `toml:"overrides,omitempty"`
29-
Ignores []string `toml:"ignores,omitempty"`
30+
Ignored []string `toml:"ignored,omitempty"`
3031
Required []string `toml:"required,omitempty"`
3132
}
3233

@@ -58,7 +59,7 @@ func fromRawManifest(raw rawManifest) (*Manifest, error) {
5859
m := &Manifest{
5960
Dependencies: make(gps.ProjectConstraints, len(raw.Dependencies)),
6061
Ovr: make(gps.ProjectConstraints, len(raw.Overrides)),
61-
Ignores: raw.Ignores,
62+
Ignored: raw.Ignored,
6263
Required: raw.Required,
6364
}
6465

@@ -123,7 +124,7 @@ func (m *Manifest) toRaw() rawManifest {
123124
raw := rawManifest{
124125
Dependencies: make([]rawProject, 0, len(m.Dependencies)),
125126
Overrides: make([]rawProject, 0, len(m.Ovr)),
126-
Ignores: m.Ignores,
127+
Ignored: m.Ignored,
127128
Required: m.Required,
128129
}
129130
for n, prj := range m.Dependencies {
@@ -206,12 +207,12 @@ func (m *Manifest) Overrides() gps.ProjectConstraints {
206207
}
207208

208209
func (m *Manifest) IgnoredPackages() map[string]bool {
209-
if len(m.Ignores) == 0 {
210+
if len(m.Ignored) == 0 {
210211
return nil
211212
}
212213

213-
mp := make(map[string]bool, len(m.Ignores))
214-
for _, i := range m.Ignores {
214+
mp := make(map[string]bool, len(m.Ignored))
215+
for _, i := range m.Ignored {
215216
mp[i] = true
216217
}
217218

manifest_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestReadManifest(t *testing.T) {
4040
Constraint: gps.NewBranch("master"),
4141
},
4242
},
43-
Ignores: []string{"github.com/foo/bar"},
43+
Ignored: []string{"github.com/foo/bar"},
4444
}
4545

4646
if !reflect.DeepEqual(got.Dependencies, want.Dependencies) {
@@ -49,8 +49,8 @@ func TestReadManifest(t *testing.T) {
4949
if !reflect.DeepEqual(got.Ovr, want.Ovr) {
5050
t.Error("Valid manifest's overrides did not parse as expected")
5151
}
52-
if !reflect.DeepEqual(got.Ignores, want.Ignores) {
53-
t.Error("Valid manifest's ignores did not parse as expected")
52+
if !reflect.DeepEqual(got.Ignored, want.Ignored) {
53+
t.Error("Valid manifest's ignored did not parse as expected")
5454
}
5555
}
5656

@@ -76,7 +76,7 @@ func TestWriteManifest(t *testing.T) {
7676
Constraint: gps.NewBranch("master"),
7777
},
7878
},
79-
Ignores: []string{"github.com/foo/bar"},
79+
Ignored: []string{"github.com/foo/bar"},
8080
}
8181

8282
got, err := m.MarshalTOML()

project_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestProjectMakeParams(t *testing.T) {
6565
p := Project{
6666
AbsRoot: "someroot",
6767
ImportRoot: gps.ProjectRoot("Some project root"),
68-
Manifest: &Manifest{Ignores: []string{"ignoring this"}},
68+
Manifest: &Manifest{Ignored: []string{"ignoring this"}},
6969
Lock: &Lock{},
7070
}
7171

testdata/manifest/error1.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ignores = ["github.com/foo/bar"]
1+
ignored = ["github.com/foo/bar"]
22

33
[[dependencies]]
44
name = "github.com/sdboyer/gps"

testdata/manifest/error2.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ignores = ["github.com/foo/bar"]
1+
ignored = ["github.com/foo/bar"]
22

33
[[dependencies]]
44
name = "github.com/sdboyer/gps"

testdata/manifest/golden.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ignores = ["github.com/foo/bar"]
1+
ignored = ["github.com/foo/bar"]
22

33
[[dependencies]]
44
name = "github.com/babble/brook"

0 commit comments

Comments
 (0)