Skip to content

Commit

Permalink
style(fmt): make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoksr committed Dec 30, 2022
1 parent 404c99a commit 7b0d6a8
Show file tree
Hide file tree
Showing 32 changed files with 47 additions and 81 deletions.
3 changes: 1 addition & 2 deletions internal/cli/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"time"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/getsentry/sentry-go"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/buildinfo"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"os"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"fmt"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
8 changes: 3 additions & 5 deletions internal/cli/proji/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import (
"path/filepath"
"strings"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"
"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/nikoksr/proji/internal/cli"
"github.com/nikoksr/proji/pkg/api/v1/domain"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/package/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (
"os/exec"
"runtime"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
12 changes: 4 additions & 8 deletions internal/cli/proji/package/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ import (
"context"
"strings"

"github.com/nikoksr/proji/pkg/pointer"

"github.com/nikoksr/proji/pkg/api/v1/domain"

"github.com/nikoksr/proji/pkg/packages/portability"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
"github.com/nikoksr/proji/pkg/api/v1/domain"
"github.com/nikoksr/proji/pkg/packages/portability"
"github.com/nikoksr/proji/pkg/packages/portability/exporting"
"github.com/nikoksr/proji/pkg/pointer"
)

func newExportCommand() *cobra.Command {
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/package/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"regexp"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/package/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package pkg
import (
"context"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
21 changes: 10 additions & 11 deletions internal/cli/proji/package/mimic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"regexp"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down Expand Up @@ -42,20 +41,20 @@ func mimicPackages(ctx context.Context, exclude string, paths ...string) error {
// Get package manager from session
logger.Debug("getting package manager from cli session")
session := cli.SessionFromContext(ctx)
pama := session.PackageManager
pama := session.PackageManager
if pama == nil {
return errors.New("no package manager available")
}

// Compile regex pattern for excluding paths. Value from flag has priority over value from config.
if exclude == "" {
exclude = session.Config.Import.Exclude
}
// Compile regex pattern for excluding paths. Value from flag has priority over value from config.
if exclude == "" {
exclude = session.Config.Import.Exclude
}

reExclude, err := regexp.Compile(exclude)
if err != nil {
return errors.Wrap(err, "compile exclude regexp")
}
reExclude, err := regexp.Compile(exclude)
if err != nil {
return errors.Wrap(err, "compile exclude regexp")
}

// Mimicking packages
logger.Debugf("mimicking %d packages", len(paths))
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/package/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package pkg
import (
"context"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/package/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package pkg
import (
"context"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/package/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"encoding/json"
"fmt"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package proji
import (
"context"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/cli"
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/proji/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/internal/buildinfo"
Expand All @@ -14,7 +15,6 @@ import (
"github.com/nikoksr/proji/internal/config"
"github.com/nikoksr/proji/internal/manager"
database "github.com/nikoksr/proji/pkg/database/bolt"
"github.com/nikoksr/simplog"
)

var db *database.DB
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/proji/server/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"strings"
"time"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/cobra"

"github.com/nikoksr/proji/pkg/sdk/health"
Expand Down
3 changes: 1 addition & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
"runtime"
"sync"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
Expand Down
1 change: 0 additions & 1 deletion internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/spf13/pflag"
)

Expand Down
3 changes: 1 addition & 2 deletions internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"strings"
"time"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"

"github.com/nikoksr/proji/internal/config"
packageRepo "github.com/nikoksr/proji/pkg/api/v1/package/repository/bolt"
Expand Down
3 changes: 1 addition & 2 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"net/http"
"time"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/nikoksr/simplog"
"go.uber.org/atomic"
"go.uber.org/zap"
"moul.io/chizap"
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/v1/domain/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/nikoksr/proji/pkg/pointer"
"github.com/pelletier/go-toml/v2"

"github.com/nikoksr/proji/pkg/pointer"
)

func TestNewPackage(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion pkg/database/bolt/bolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"github.com/nikoksr/simplog"

bolt "go.etcd.io/bbolt"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/httputil/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"os"
"path"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"

"github.com/nikoksr/proji/pkg/remote"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/httputil/httputil.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"net/http"
"strings"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
)

var httpClient = &http.Client{
Expand Down
3 changes: 1 addition & 2 deletions pkg/packages/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (
"path"
"path/filepath"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"

"github.com/nikoksr/proji/pkg/api/v1/domain"
"github.com/nikoksr/proji/pkg/remote"
Expand Down
5 changes: 2 additions & 3 deletions pkg/packages/portability/exporting/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"encoding/json"
"os"

"github.com/cockroachdb/errors"
"github.com/pelletier/go-toml/v2"

"github.com/nikoksr/proji/pkg/packages/portability"

"github.com/cockroachdb/errors"
"github.com/nikoksr/proji/pkg/api/v1/domain"
"github.com/nikoksr/proji/pkg/packages/portability"
)

func encodeJSON(data *bytes.Buffer, pkg *domain.PackageConfig) error {
Expand Down
3 changes: 1 addition & 2 deletions pkg/packages/portability/exporting/exporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package exporting
import (
"context"

"github.com/nikoksr/proji/pkg/packages/portability"

"github.com/nikoksr/proji/pkg/api/v1/domain"
"github.com/nikoksr/proji/pkg/packages/portability"
)

type (
Expand Down
3 changes: 1 addition & 2 deletions pkg/packages/portability/exporting/exporting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"path/filepath"
"testing"

"github.com/nikoksr/proji/pkg/packages/portability"

"github.com/google/go-cmp/cmp"

"github.com/nikoksr/proji/pkg/api/v1/domain"
"github.com/nikoksr/proji/pkg/packages/portability"
"github.com/nikoksr/proji/pkg/packages/portability/importing"
"github.com/nikoksr/proji/pkg/pointer"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/packages/portability/importing/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"path/filepath"
"regexp"

"github.com/nikoksr/proji/pkg/packages/portability"

"github.com/cockroachdb/errors"

"github.com/nikoksr/proji/pkg/api/v1/domain"
"github.com/nikoksr/proji/pkg/packages/portability"
)

// LocalPackage reads a TOML file and returns a package. It returns an error if the file is not a TOML file, or it was not
Expand Down
3 changes: 1 addition & 2 deletions pkg/remote/platform/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"net/http"
"time"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
gh "github.com/google/go-github/v31/github"
"github.com/nikoksr/simplog"
"golang.org/x/oauth2"

"github.com/nikoksr/proji/pkg/api/v1/domain"
Expand Down
3 changes: 1 addition & 2 deletions pkg/remote/platform/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (
"strings"
"time"

"github.com/nikoksr/simplog"

"github.com/cockroachdb/errors"
"github.com/nikoksr/simplog"
gl "github.com/xanzy/go-gitlab"

"github.com/nikoksr/proji/pkg/api/v1/domain"
Expand Down
Loading

0 comments on commit 7b0d6a8

Please sign in to comment.