Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GitHub check annotations #221

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"

// GenericBar is a test type.
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)
}
20 changes: 20 additions & 0 deletions pkg/moq/testpackages/shadowtypes/shadowtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,52 @@ import (
"github.com/matryer/moq/pkg/moq/testpackages/shadowtypes/types"
)

// ShadowTypes is a test interface.
type ShadowTypes interface {
// ShadowString is a test method.
ShadowString(string, types.String)

// ShadowInt is a test method.
ShadowInt(int, types.Int)
// ShadowInt8 is a test method.
ShadowInt8(int8, types.Int8)
// ShadowInt16 is a test method.
ShadowInt16(int16, types.Int16)
// ShadowInt32 is a test method.
ShadowInt32(int32, types.Int32)
// ShadowInt64 is a test method.
ShadowInt64(int64, types.Int64)

// ShadowUint is a test method.
ShadowUint(uint, types.Uint)
// ShadowUint8 is a test method.
ShadowUint8(uint8, types.Uint8)
// ShadowUint16 is a test method.
ShadowUint16(uint16, types.Uint16)
// ShadowUint32 is a test method.
ShadowUint32(uint32, types.Uint32)
// ShadowUint64 is a test method.
ShadowUint64(uint64, types.Uint64)

// ShadowFloat32 is a test method.
ShadowFloat32(float32, types.Float32)
// ShadowFloat64 is a test method.
ShadowFloat64(float64, types.Float64)

// ShadowByte is a test method.
ShadowByte(byte, types.Byte)

// ShadowRune is a test method.
ShadowRune(rune, types.Rune)

// ShadowBool is a test method.
ShadowBool(bool, types.Bool)

// ShadowComplex64 is a test method.
ShadowComplex64(complex64, types.Complex64)
// ShadowComplex128 is a test method.
ShadowComplex128(complex128, types.Complex128)

// ShadowUintptr is a test method.
ShadowUintptr(uintptr, types.Uintptr)
}
19 changes: 19 additions & 0 deletions pkg/moq/testpackages/shadowtypes/types/types.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
package types

// String is a test type.
type String string

// Int is a test type.
type Int int
// Int8 is a test type.
type Int8 int8
// Int16 is a test type.
type Int16 int16
// Int32 is a test type.
type Int32 int32
// Int64 is a test type.
type Int64 int64

// Uint is a test type.
type Uint uint
// Uint8 is a test type.
type Uint8 uint
// Uint16 is a test type.
type Uint16 uint
// Uint32 is a test type.
type Uint32 uint
// Uint64 is a test type.
type Uint64 uint

// Float32 is a test type.
type Float32 float32
// Float64 is a test type.
type Float64 float64

// Byte is a test type.
type Byte byte

// Rune is a test type.
type Rune rune

// Bool is a test type.
type Bool bool

// Complex64 is a test type.
type Complex64 complex64
// Complex128 is a test type.
type Complex128 complex128

// Uintptr is a test type.
type Uintptr uintptr
1 change: 1 addition & 0 deletions pkg/moq/testpackages/syncimport/sync/thing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package sync

// Thing is a test type.
type Thing string
1 change: 1 addition & 0 deletions pkg/moq/testpackages/syncimport/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/matryer/moq/pkg/moq/testpackages/syncimport/sync"
)

// Syncer is a test interface.
type Syncer interface {
Blah(s sync.Thing, wg *stdsync.WaitGroup)
}
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/base/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
two "github.com/matryer/moq/pkg/moq/testpackages/transientimport/two/app/v1"
)

// Transient is a test interface.
type Transient interface {
DoSomething(onev1.Zero, one.One, two.Two, three.Three, four.Four)
}
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/four/app/v1/four.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package v1

// Four is a test type.
type Four string
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/one/v1/one.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package v1

// One is a test type.
type One string
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/onev1/zero.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package onev1

// Zero is a test type.
type Zero string
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/three/v1/three.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package v1

// Three is a test type.
type Three string
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/transient.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import (
"github.com/matryer/moq/pkg/moq/testpackages/transientimport/base"
)

// Transient is a test interface.
type Transient = base.Transient
1 change: 1 addition & 0 deletions pkg/moq/testpackages/transientimport/two/app/v1/two.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package v1

// Two is a test type.
type Two string
1 change: 1 addition & 0 deletions pkg/moq/testpackages/variadic/echoer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package variadic

// Echoer is an interface.
type Echoer interface {
Echo(ss ...string) []string
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading