Skip to content

Commit b40ae87

Browse files
committed
Various fixes suggested by copilot
Signed-off-by: Brian Goff <[email protected]>
1 parent ed94060 commit b40ae87

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

docs/spec.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,14 +957,14 @@
957957
"string",
958958
"null"
959959
],
960-
"description": "Header is the name of the secret which contains the git auth header.\nwhen using git auth header based authentication.\nNote: This should not have the *actual* secret value, just the name of\nthe secret which was specified as a build secret."
960+
"description": "Header is the name of the secret which contains the git auth header.\nWhen using git auth header based authentication.\nNote: This should not have the *actual* secret value, just the name of\nthe secret which was specified as a build secret."
961961
},
962962
"ssh": {
963963
"type": [
964964
"string",
965965
"null"
966966
],
967-
"description": "SSH is the name of the secret which contains the ssh auth into when using\nssh based auth.\nNote: This should not have the *actual* secret value, just the name of\nthe secret which was specified as a build secret."
967+
"description": "SSH is the name of the secret which contains the ssh auth info when using\nssh based auth.\nNote: This should not have the *actual* secret value, just the name of\nthe secret which was specified as a build secret."
968968
},
969969
"token": {
970970
"type": [

helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ func ErrorState(in llb.State, err error) llb.State {
705705
return asyncState(in, err)
706706
}
707707

708-
// NoopStateOption returns a [llb.StateOption] that does not change the input state.
708+
// NoopStateOption is a [llb.StateOption] that does not change the input state.
709709
func NoopStateOption(in llb.State) llb.State {
710710
return in
711711
}

source_git.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type SourceGit struct {
2020

2121
type GitAuth struct {
2222
// Header is the name of the secret which contains the git auth header.
23-
// when using git auth header based authentication.
23+
// When using git auth header based authentication.
2424
// Note: This should not have the *actual* secret value, just the name of
2525
// the secret which was specified as a build secret.
2626
Header string `yaml:"header,omitempty" json:"header,omitempty"`
@@ -29,7 +29,7 @@ type GitAuth struct {
2929
// Note: This should not have the *actual* secret value, just the name of
3030
// the secret which was specified as a build secret.
3131
Token string `yaml:"token,omitempty" json:"token,omitempty"`
32-
// SSH is the name of the secret which contains the ssh auth into when using
32+
// SSH is the name of the secret which contains the ssh auth info when using
3333
// ssh based auth.
3434
// Note: This should not have the *actual* secret value, just the name of
3535
// the secret which was specified as a build secret.

source_inline.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ func (s *SourceInline) validate(opts fetchOptions) (retErr error) {
109109
if opts.Excludes != nil {
110110
errs = append(errs, errors.New("inline file source cannot have excludes set"))
111111
}
112-
if err := s.File.validate(); err != nil {
113-
errs = append(errs, err)
114-
}
115-
116112
if err := s.File.validate(); err != nil {
117113
errs = append(errs, errors.Wrap(err, "inline file source validation failed"))
118114
}

source_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ exit 0
246246
}
247247
if st == nil {
248248
t.Fatal("gomod generator succeeded but return value was nil")
249-
return nil, nil
250249
}
251250

252251
def, err := st.Marshal(ctx)
@@ -814,7 +813,6 @@ func TestSourceInlineDir(t *testing.T) {
814813
func checkMkdir(t *testing.T, op *pb.FileOp, src *SourceInlineDir) {
815814
if op == nil {
816815
t.Fatal("expected dir op")
817-
return
818816
}
819817

820818
if len(op.Actions) != 1 {
@@ -824,7 +822,6 @@ func checkMkdir(t *testing.T, op *pb.FileOp, src *SourceInlineDir) {
824822
mkdir := op.Actions[0].GetMkdir()
825823
if mkdir == nil {
826824
t.Fatalf("expected mkdir action: %v", op.Actions[0])
827-
return
828825
}
829826

830827
if mkdir.MakeParents {
@@ -854,7 +851,6 @@ func checkMkdir(t *testing.T, op *pb.FileOp, src *SourceInlineDir) {
854851
func checkMkfile(t *testing.T, op *pb.FileOp, src *SourceInlineFile, name string) {
855852
if op == nil {
856853
t.Fatal("expected file op")
857-
return
858854
}
859855

860856
if len(op.Actions) != 1 {
@@ -864,7 +860,6 @@ func checkMkfile(t *testing.T, op *pb.FileOp, src *SourceInlineFile, name string
864860
mkfile := op.Actions[0].GetMkfile()
865861
if mkfile == nil {
866862
t.Fatalf("expected mkfile action: %v", op.Actions[0])
867-
return
868863
}
869864

870865
uid := mkfile.Owner.User.GetByID()
@@ -1164,7 +1159,6 @@ func checkFilter(t *testing.T, op *pb.FileOp, src *Source) {
11641159
cpAction := op.Actions[0].GetCopy()
11651160
if cpAction == nil {
11661161
t.Fatal("expected copy action")
1167-
return
11681162
}
11691163

11701164
if cpAction.Dest != "/" {

0 commit comments

Comments
 (0)