Skip to content

Commit 66a03fb

Browse files
author
anna-cross
committed
lint
lint lint and tests
1 parent 448b607 commit 66a03fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12377
-431
lines changed

.golangci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ linters-settings:
2222
gocyclo:
2323
min-complexity: 15
2424
govet:
25-
check-shadowing: true
25+
enable:
26+
- shadow
2627
settings:
2728
printf:
2829
funcs:
@@ -83,7 +84,6 @@ linters:
8384
- gochecknoinits
8485
- goconst
8586
- gocyclo
86-
- godot
8787
- gofmt
8888
- goimports
8989
- goprintffuncname

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fig:
4444
# downgrade linter until https://github.com/golangci/golangci-lint/issues/4239 is fixed
4545
.PHONY: lint
4646
lint:
47-
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:v1.54.2 golangci-lint run --timeout 5m -v
47+
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:v1.57.2 golangci-lint run --timeout 5m -v
4848

4949
.PHONY: generate
5050
generate: mockgen-install

cmd/meroxa/global/config.go

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func GetMeroxaTenantUser() string {
4343
// getEnvVal returns the value of either the first existing key specified in keys, or defaultVal if none were present.
4444
func getEnvVal(keys []string, defaultVal string) string {
4545
for _, key := range keys {
46-
4746
if Config != nil {
4847
// First tries to return the value from the meroxa configuration file
4948
if val := Config.GetString(key); val != "" {

cmd/meroxa/global/global.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ const (
4747
UserFeatureFlagsEnv = "USER_FEATURE_FLAGS"
4848
UserInfoUpdatedAtEnv = "USER_INFO_UPDATED_AT"
4949
TenantEmailAddress = "TENANT_EMAIL_ADDRESS"
50-
// TenantPassword = "TENANT_PASSWORD"
51-
TenantURL = "TENANT_URL"
50+
TenantURL = "TENANT_URL"
5251

5352
defaultClientTimeout = time.Second * 10
5453
)

cmd/meroxa/root/apps/apps.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type Application struct {
8787
State string `json:"state"`
8888
ApplicationSpec string `json:"stream_tech"`
8989
Config string `json:"config"`
90-
PipelineFilenames string `json:"pipeline_filenames"`
90+
PipelineFilenames string `json:"pipeline_filename"`
9191
PipelineEnriched string `json:"pipeline_enriched"`
9292
PipelineOriginal string `json:"pipeline_original"`
9393

@@ -166,7 +166,7 @@ func (*Apps) SubCommands() []*cobra.Command {
166166
}
167167
}
168168

169-
func RetrieveApplicationByNameOrID(ctx context.Context, client global.BasicClient, nameOrID, path string) (*Applications, error) {
169+
func RetrieveApplicationByNameOrID(ctx context.Context, client global.BasicClient, nameOrID string) (*Applications, error) {
170170
apps := Applications{}
171171
if nameOrID != "" {
172172
a := &url.Values{}

cmd/meroxa/root/apps/deploy.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ func (d *Deploy) Execute(ctx context.Context) error {
190190

191191
d.path, err = GetPath(d.flags.Path)
192192
if err != nil {
193-
return err
193+
return fmt.Errorf("error getting conduit app path - %s", err)
194194
}
195195

196196
var buf bytes.Buffer
197-
d.gzipConduitApp(d.path, &buf)
197+
err = d.gzipConduitApp(d.path, &buf)
198+
if err != nil {
199+
return fmt.Errorf("error zipping conduit app repository - %s", err)
200+
}
198201

199202
dFile := fmt.Sprintf("conduit-%s.tar.gz", uuid.NewString())
200203
fileToWrite, err := os.OpenFile(dFile, os.O_CREATE|os.O_RDWR, os.FileMode(0o777)) //nolint:gomnd

cmd/meroxa/root/apps/describe.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ meroxa apps describe NAME `,
6565
}
6666

6767
func (d *Describe) Execute(ctx context.Context) error {
68-
apps := &Applications{}
69-
var err error
70-
71-
apps, err = RetrieveApplicationByNameOrID(ctx, d.client, d.args.nameOrUUID, d.flags.Path)
68+
apps, err := RetrieveApplicationByNameOrID(ctx, d.client, d.args.nameOrUUID)
7269
if err != nil {
7370
return err
7471
}

0 commit comments

Comments
 (0)