diff --git a/Taskfile.yml b/Taskfile.yml index 02368af2..4faea016 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -8,6 +8,9 @@ vars: BUILD_DATE: { sh: date '+%Y-%m-%d-%H:%M:%S' } IMAGE_NAME: "esnet/gdg" LD_FLAGS: "-s -w -X github.com/esnet/gdg/internal/version.GitCommit={{ .GIT_COMMIT}}{{ .GIT_DIRTY}} -X github.com/esnet/gdg/internal/version.BuildDate={{ .BUILD_DATE }} " + LEFTHOOK_VERSION: "v1.6.7" + MOCKERY_VERSION: "v2.42.0" + RELEASER_VERSION: "v1.24.0" dotenv: [ '.env' ] @@ -22,8 +25,11 @@ tasks: - go install github.com/client9/misspell/cmd/misspell@latest - go install github.com/securego/gosec/v2/cmd/gosec@master - go install golang.org/x/vuln/cmd/govulncheck@latest - - go install github.com/vektra/mockery/v2@v2.42.0 - - go install github.com/goreleaser/goreleaser@v1.24.0 + - go install github.com/vektra/mockery/v2@{{ .MOCKERY_VERSION}} + - go install github.com/goreleaser/goreleaser@{{ .RELEASER_VERSION }} + - go install github.com/evilmartians/lefthook@{{ .LEFTHOOK_VERSION }} + - lefthook install + security: desc: "Run security scan" cmds: diff --git a/cli/tools/organizations.go b/cli/tools/organizations.go index 2da5c033..a4e6b978 100644 --- a/cli/tools/organizations.go +++ b/cli/tools/organizations.go @@ -216,7 +216,7 @@ func newAddUserRoleCmd() simplecobra.Commander { } func newDeleteUserRoleCmd() simplecobra.Commander { - description := "deleteUser removes a user from the given Organization (This will NOT delete the actual user from Grafana)" + description := "deleteUser removes a user from the given Organization (This will NOT delete the actual user from Grafana)" return &support.SimpleCommand{ NameP: "deleteUser", Short: description, diff --git a/internal/service/organizations.go b/internal/service/organizations.go index 5de3fa7f..d820dd47 100644 --- a/internal/service/organizations.go +++ b/internal/service/organizations.go @@ -253,7 +253,7 @@ func (s *DashNGoImpl) UploadOrganizations(filter filters.Filter) []string { if err != nil { log.Fatalf("Failed to read folders imports, err: %v", err) } - orgListing := s.ListOrganizations(filter, true) + orgListing := s.ListOrganizations(filter, false) orgMap := map[string]bool{} for _, entry := range orgListing { orgMap[entry.Organization.Name] = true diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 00000000..e1d0b482 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,9 @@ +min_version: 1.4.3 + +pre-commit: + parallel: true + commands: + backend-format: + glob: '**/*.go' + run: gofmt -w -s {staged_files} + stage_fixed: true