Skip to content

Commit

Permalink
Fix GitHub check annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
HaraldNordgren committed Jul 28, 2024
1 parent 0bf2e8a commit fd604c6
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/template/template_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (m MethodData) ReturnArgNameList() string {
return strings.Join(params, ", ")
}

// TypeParamData extends ParamData with a constraint.
type TypeParamData struct {
ParamData
Constraint types.Type
Expand Down
1 change: 1 addition & 0 deletions pkg/moq/testpackages/anonimport/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
)

// Example is a test interface.
type Example interface {
Ctx(ctx context.Context)
}
2 changes: 1 addition & 1 deletion pkg/moq/testpackages/anonimport/second_file.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package anonimport

import (
_ "context"
_ "context" // import for side effects
)
1 change: 1 addition & 0 deletions pkg/moq/testpackages/blankid/swallower.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package blankid

// Swallower is a test interface.
type Swallower interface {
Swallow(_ string)
}
2 changes: 2 additions & 0 deletions pkg/moq/testpackages/genericreturn/genericreturn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package genericreturn

import "github.com/matryer/moq/pkg/moq/testpackages/genericreturn/otherpackage"

// GenericFoo is a test type.

Check failure on line 5 in pkg/moq/testpackages/genericreturn/genericreturn.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.18.x)

comment on exported type GenericBar should be of the form "GenericBar ..." (with optional leading article)

Check failure on line 5 in pkg/moq/testpackages/genericreturn/genericreturn.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.19.x)

comment on exported type GenericBar should be of the form "GenericBar ..." (with optional leading article)
type GenericBar[T any] struct {
Bar T
}

// IFooBar is a test interface.
type IFooBar interface {
Foobar() GenericBar[otherpackage.Foo]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package otherpackage

// Foo is a test struct.
type Foo struct {
A int
B string
Expand Down
6 changes: 6 additions & 0 deletions pkg/moq/testpackages/generics/generics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@ import (
"fmt"
)

// GenericStore1 is a test interface.
type GenericStore1[T Key1, S any] interface {
Get(ctx context.Context, id T) (S, error)
Create(ctx context.Context, id T, value S) error
}

// GenericStore2 is a test interface.
type GenericStore2[T Key2, S any] interface {
Get(ctx context.Context, id T) (S, error)
Create(ctx context.Context, id T, value S) error
}

// AliasStore is a test interface.
type AliasStore GenericStore1[KeyImpl, bool]

// Key1 is a test interface.
type Key1 interface {
fmt.Stringer
}

// Key2 is a test interface.
type Key2 interface {
~[]byte | string
}

// KeyImpl is a test type.
type KeyImpl []byte

func (x KeyImpl) String() string {
Expand Down
5 changes: 4 additions & 1 deletion pkg/moq/testpackages/genparamname/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import (
)

type (
Go func()
// Go is a test function.
Go func()

myType struct{}
)

// Interface is a test interface.
type Interface interface {
Method(
*myType,
Expand Down
1 change: 1 addition & 0 deletions pkg/moq/testpackages/importalias/middleman.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
tgtclient "github.com/matryer/moq/pkg/moq/testpackages/importalias/target/client"
)

// MiddleMan is a test interface.
type MiddleMan interface {
Connect(src srcclient.Client, tgt tgtclient.Client)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package client

// Client is a test struct.
type Client struct{}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package client

// Client is a test struct.
type Client struct{}
1 change: 1 addition & 0 deletions pkg/moq/testpackages/paramconflict/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package paramconflict

import "time"

// Interface is a test interface.
type Interface interface {
Method(string, bool, string, bool, int, int32, int64, float32, float64, time.Time, time.Time)
}
1 change: 1 addition & 0 deletions pkg/moq/testpackages/shadow/http/thing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package http

import "net/http"

// Thing is a test interface.
type Thing interface {
Blah(w http.ResponseWriter, r *http.Request)
}

0 comments on commit fd604c6

Please sign in to comment.