From f18653f9c78d451363532b53ab61db3ba792c4b6 Mon Sep 17 00:00:00 2001 From: Tyler Auerbeck Date: Wed, 16 Oct 2024 20:41:12 -0400 Subject: [PATCH 1/2] add initial .golangci.yaml config with formatter Signed-off-by: Tyler Auerbeck --- .golangci.yaml | 16 ++++++++++++++++ cmd/harbor/root/health.go | 2 +- pkg/api/health_handler.go | 2 +- pkg/views/health/view.go | 4 ++-- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 00000000..69748880 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,16 @@ +#linters-settings: +# gofumpt: +# extra-rules: true + +linters: + enable: + # default linters + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - typecheck + - unused + + - gofmt diff --git a/cmd/harbor/root/health.go b/cmd/harbor/root/health.go index 9baf4dfa..eae8257c 100644 --- a/cmd/harbor/root/health.go +++ b/cmd/harbor/root/health.go @@ -2,8 +2,8 @@ package root import ( "github.com/goharbor/harbor-cli/pkg/api" - "github.com/spf13/cobra" "github.com/goharbor/harbor-cli/pkg/views/health" + "github.com/spf13/cobra" ) func HealthCommand() *cobra.Command { diff --git a/pkg/api/health_handler.go b/pkg/api/health_handler.go index d8eceb37..ac21531b 100644 --- a/pkg/api/health_handler.go +++ b/pkg/api/health_handler.go @@ -13,7 +13,7 @@ func GetHealth() (*health.GetHealthOK, error) { return nil, err } - response, err := client.Health.GetHealth(ctx,&health.GetHealthParams{}) + response, err := client.Health.GetHealth(ctx, &health.GetHealthParams{}) if err != nil { return nil, fmt.Errorf("error getting health status: %w", err) } diff --git a/pkg/views/health/view.go b/pkg/views/health/view.go index 31813d15..e94460b3 100644 --- a/pkg/views/health/view.go +++ b/pkg/views/health/view.go @@ -5,7 +5,7 @@ import ( "os" "github.com/charmbracelet/bubbles/table" - "github.com/charmbracelet/bubbletea" + tea "github.com/charmbracelet/bubbletea" "github.com/goharbor/go-client/pkg/sdk/v2.0/client/health" "github.com/goharbor/harbor-cli/pkg/views" "github.com/goharbor/harbor-cli/pkg/views/base/tablelist" @@ -39,4 +39,4 @@ func styleStatus(status string) string { return views.GreenStyle.Render(status) } return views.RedStyle.Render(status) -} \ No newline at end of file +} From 4180067db18e150c038d178b5fac3aed23a9ea00 Mon Sep 17 00:00:00 2001 From: Tyler Auerbeck Date: Wed, 16 Oct 2024 20:43:12 -0400 Subject: [PATCH 2/2] remove commented lint config Signed-off-by: Tyler Auerbeck --- .golangci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 69748880..1ed0475f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,6 +1,3 @@ -#linters-settings: -# gofumpt: -# extra-rules: true linters: enable: