feat(Makefile): add formatting target

Signed-off-by: Adam Reese <adam@reese.io>
pull/5284/head
Adam Reese 5 years ago
parent 16b59bfe5b
commit f791421fab
No known key found for this signature in database
GPG Key ID: 06F35E60A7A18DD6

@ -6,6 +6,7 @@ BINNAME ?= helm
GOPATH = $(shell go env GOPATH)
DEP = $(GOPATH)/bin/dep
GOX = $(GOPATH)/bin/gox
GOIMPORTS = $(GOPATH)/bin/goimports
# go option
PKG := ./...
@ -81,6 +82,10 @@ verify-docs: build
coverage:
@scripts/coverage.sh
.PHONY: format
format: $(GOIMPORTS)
go list -f '{{.Dir}}' ./... | xargs $(GOIMPORTS) -w -local k8s.io/helm
# ------------------------------------------------------------------------------
# dependencies
@ -93,6 +98,9 @@ $(DEP):
$(GOX):
go get -u github.com/mitchellh/gox
$(GOIMPORTS):
go get -u golang.org/x/tools/cmd/goimports
# install vendored dependencies
vendor: Gopkg.lock
$(DEP) ensure -v --vendor-only

@ -24,11 +24,9 @@ import (
"testing"
"time"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/helm/pkg/tiller/environment"
shellwords "github.com/mattn/go-shellwords"
"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/helm/internal/test"
"k8s.io/helm/pkg/action"
@ -38,6 +36,7 @@ import (
"k8s.io/helm/pkg/repo"
"k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage/driver"
"k8s.io/helm/pkg/tiller/environment"
)
func testTimestamper() time.Time { return time.Unix(242085845, 0).UTC() }

@ -20,10 +20,10 @@ import (
"os"
"os/exec"
"k8s.io/helm/pkg/plugin"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"k8s.io/helm/pkg/plugin"
)
const pluginHelp = `

@ -19,12 +19,12 @@ import (
"fmt"
"io"
"github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/helm/helmpath"
"k8s.io/helm/pkg/plugin"
"k8s.io/helm/pkg/plugin/installer"
"github.com/spf13/cobra"
)
type pluginInstallOptions struct {

@ -19,10 +19,10 @@ import (
"fmt"
"io"
"k8s.io/helm/pkg/helm/helmpath"
"github.com/gosuri/uitable"
"github.com/spf13/cobra"
"k8s.io/helm/pkg/helm/helmpath"
)
type pluginListOptions struct {

@ -23,10 +23,10 @@ import (
"strings"
"testing"
"github.com/spf13/cobra"
"k8s.io/helm/pkg/helm/helmpath"
"k8s.io/helm/pkg/plugin"
"github.com/spf13/cobra"
)
func TestManuallyProcessArgs(t *testing.T) {

@ -24,6 +24,7 @@ import (
"github.com/pkg/errors"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/helm/pkg/chart"
"k8s.io/helm/pkg/hapi/release"
"k8s.io/helm/pkg/storage"

@ -20,6 +20,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/helm/pkg/hapi/release"
"k8s.io/helm/pkg/storage"
)

@ -21,9 +21,9 @@ import (
"strings"
"testing"
"k8s.io/helm/pkg/helm/helmpath"
"github.com/spf13/pflag"
"k8s.io/helm/pkg/helm/helmpath"
)
func TestEnvSettings(t *testing.T) {

@ -32,7 +32,7 @@ import (
appsv1beta1 "k8s.io/api/apps/v1beta1"
appsv1beta2 "k8s.io/api/apps/v1beta2"
batch "k8s.io/api/batch/v1"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
extv1beta1 "k8s.io/api/extensions/v1beta1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"

@ -24,7 +24,7 @@ import (
"strings"
"testing"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

@ -22,7 +22,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
appsv1beta1 "k8s.io/api/apps/v1beta1"
appsv1beta2 "k8s.io/api/apps/v1beta2"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"

@ -18,10 +18,9 @@ package lint
import (
"strings"
"testing"
"k8s.io/helm/pkg/lint/support"
"testing"
)
var values map[string]interface{}

@ -22,9 +22,9 @@ import (
"path/filepath"
"testing"
"k8s.io/helm/pkg/helm/helmpath"
"github.com/Masterminds/vcs"
"k8s.io/helm/pkg/helm/helmpath"
)
var _ Installer = new(VCSInstaller)

@ -23,9 +23,9 @@ import (
"runtime"
"strings"
helm_env "k8s.io/helm/pkg/helm/environment"
"github.com/ghodss/yaml"
helm_env "k8s.io/helm/pkg/helm/environment"
)
const pluginFileName = "plugin.yaml"

@ -21,7 +21,6 @@ import (
"context"
"fmt"
"io"
"k8s.io/helm/pkg/chart"
"net"
"os"
"testing"
@ -31,8 +30,9 @@ import (
"github.com/docker/distribution/configuration"
"github.com/docker/distribution/registry"
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/stretchr/testify/suite"
"k8s.io/helm/pkg/chart"
)
var (

@ -22,7 +22,7 @@ import (
"log"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/helm/pkg/hapi"
"k8s.io/helm/pkg/hapi/release"

@ -22,7 +22,7 @@ import (
"github.com/ghodss/yaml"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/helm/pkg/hapi/release"
"k8s.io/helm/pkg/hooks"

@ -21,7 +21,7 @@ import (
"testing"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/helm/pkg/hapi"
"k8s.io/helm/pkg/hapi/release"

@ -24,6 +24,7 @@ import (
"github.com/pkg/errors"
yaml "gopkg.in/yaml.v2"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/hapi/release"
"k8s.io/helm/pkg/hooks"

@ -22,8 +22,7 @@ import (
"time"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kblabels "k8s.io/apimachinery/pkg/labels"

@ -19,7 +19,7 @@ import (
"reflect"
"testing"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
rspb "k8s.io/helm/pkg/hapi/release"
)

@ -20,7 +20,7 @@ import (
"fmt"
"testing"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"

@ -22,8 +22,7 @@ import (
"time"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kblabels "k8s.io/apimachinery/pkg/labels"

@ -19,7 +19,7 @@ import (
"reflect"
"testing"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
rspb "k8s.io/helm/pkg/hapi/release"
)

@ -26,7 +26,7 @@ import (
"io"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/cli-runtime/pkg/genericclioptions/resource"
"k8s.io/helm/pkg/kube"

@ -22,7 +22,7 @@ import (
"testing"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/cli-runtime/pkg/genericclioptions/resource"
"k8s.io/helm/pkg/kube"

Loading…
Cancel
Save