Skip to content

Commit

Permalink
Add format target to Makefile (#81)
Browse files Browse the repository at this point in the history
* Add format target to Makefile

* make format
  • Loading branch information
mattt committed Apr 17, 2024
1 parent 32aa25c commit 4b0222c
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 17 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ clean:
test:
$(GO) test -v ./...

.PHONY: format
format:
$(GO) run golang.org/x/tools/cmd/goimports@latest -d -w -local $(shell $(GO) list -m) .

.PHONY: lint
lint: lint-golangci lint-nilaway

Expand Down
3 changes: 2 additions & 1 deletion internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"
"os"

"github.com/replicate/replicate-go"

"github.com/replicate/cli/internal"
"github.com/replicate/cli/internal/config"
"github.com/replicate/replicate-go"
)

func NewClient(opts ...replicate.ClientOption) (*replicate.Client, error) {
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"os"
"strings"

"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/config"
"github.com/spf13/cobra"
)

// loginCmd represents the login command
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/model/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"fmt"

"github.com/cli/browser"
"github.com/replicate/replicate-go"
"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/identifier"
"github.com/replicate/cli/internal/util"
"github.com/replicate/replicate-go"
"github.com/spf13/cobra"
)

// createCmd represents the create command
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/model/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"
"os/exec"

"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/util"
"github.com/spf13/cobra"

"github.com/charmbracelet/bubbles/table"
tea "github.com/charmbracelet/bubbletea"
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/model/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"fmt"

"github.com/cli/browser"
"github.com/replicate/replicate-go"
"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/identifier"
"github.com/replicate/cli/internal/util"
"github.com/replicate/replicate-go"
"github.com/spf13/cobra"
)

var showCmd = &cobra.Command{
Expand Down
7 changes: 4 additions & 3 deletions internal/cmd/prediction/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import (
"github.com/briandowns/spinner"
"github.com/cli/browser"
"github.com/getkin/kin-openapi/openapi3"
"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/identifier"
"github.com/replicate/cli/internal/util"
"github.com/replicate/replicate-go"
"github.com/schollz/progressbar/v3"
"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/identifier"
"github.com/replicate/cli/internal/util"
)

var CreateCmd = &cobra.Command{
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/prediction/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"
"os/exec"

"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/util"
"github.com/spf13/cobra"

"github.com/charmbracelet/bubbles/table"
tea "github.com/charmbracelet/bubbletea"
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/prediction/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"

"github.com/cli/browser"
"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/util"
"github.com/spf13/cobra"
)

var showCmd = &cobra.Command{
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/training/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (

"github.com/briandowns/spinner"
"github.com/cli/browser"
"github.com/replicate/replicate-go"
"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/identifier"
"github.com/replicate/cli/internal/util"
"github.com/replicate/replicate-go"
"github.com/spf13/cobra"
)

// CreateCmd represents the create command
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/training/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"fmt"
"os/exec"

"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/util"
"github.com/spf13/cobra"

"github.com/charmbracelet/bubbles/table"
tea "github.com/charmbracelet/bubbletea"
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/training/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"

"github.com/cli/browser"
"github.com/spf13/cobra"

"github.com/replicate/cli/internal/client"
"github.com/replicate/cli/internal/util"
"github.com/spf13/cobra"
)

var showCmd = &cobra.Command{
Expand Down
3 changes: 2 additions & 1 deletion internal/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
"testing"

"github.com/getkin/kin-openapi/openapi3"
"github.com/replicate/cli/internal/util"
"github.com/replicate/replicate-go"
"github.com/stretchr/testify/assert"

"github.com/replicate/cli/internal/util"
)

func TestParseInputs(t *testing.T) {
Expand Down

0 comments on commit 4b0222c

Please sign in to comment.