Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gofmt and golint issues and added the check in CI #126

Merged
merged 1 commit into from
May 26, 2020

Conversation

parauliya
Copy link
Contributor

@parauliya parauliya commented May 21, 2020

This PR has the following things
1. Fixed the goimports and golint issue in the current code.
2. Add check for goimports and golint issues in the CI pipeline

@parauliya parauliya requested a review from gauravgahlot May 21, 2020 11:11
Copy link
Contributor

@mmlb mmlb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running goimports -w . I get:

~/go/src/github.com/tinkerbell/tink> git diff | e:cat
diff --git a/protos/hardware/hardware.pb.go b/protos/hardware/hardware.pb.go
index da25773..4f4b60e 100644
--- a/protos/hardware/hardware.pb.go
+++ b/protos/hardware/hardware.pb.go
@@ -6,11 +6,12 @@ package hardware
 import (
 	context "context"
 	fmt "fmt"
+	math "math"
+
 	proto "github.com/golang/protobuf/proto"
 	grpc "google.golang.org/grpc"
 	codes "google.golang.org/grpc/codes"
 	status "google.golang.org/grpc/status"
-	math "math"
 )
 
 // Reference imports to suppress errors if they are not otherwise used.
diff --git a/protos/template/template.pb.go b/protos/template/template.pb.go
index f793cb9..89a863c 100644
--- a/protos/template/template.pb.go
+++ b/protos/template/template.pb.go
@@ -6,12 +6,13 @@ package template
 import (
 	context "context"
 	fmt "fmt"
+	math "math"
+
 	proto "github.com/golang/protobuf/proto"
 	timestamp "github.com/golang/protobuf/ptypes/timestamp"
 	grpc "google.golang.org/grpc"
 	codes "google.golang.org/grpc/codes"
 	status "google.golang.org/grpc/status"
-	math "math"
 )
 
 // Reference imports to suppress errors if they are not otherwise used.
diff --git a/protos/workflow/workflow.pb.go b/protos/workflow/workflow.pb.go
index ec89a58..b5db11a 100644
--- a/protos/workflow/workflow.pb.go
+++ b/protos/workflow/workflow.pb.go
@@ -6,12 +6,13 @@ package workflow
 import (
 	context "context"
 	fmt "fmt"
+	math "math"
+
 	proto "github.com/golang/protobuf/proto"
 	timestamp "github.com/golang/protobuf/ptypes/timestamp"
 	grpc "google.golang.org/grpc"
 	codes "google.golang.org/grpc/codes"
 	status "google.golang.org/grpc/status"
-	math "math"
 )

cmd/tink-worker/worker.go Outdated Show resolved Hide resolved
client/main.go Outdated Show resolved Hide resolved
test/framework/worker.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@mmlb
Copy link
Contributor

mmlb commented May 21, 2020

Also lets use goimports instead of gofmt since it does better handling of imports.

@parauliya parauliya force-pushed the fix_fmt_lint_issue branch from ae3b6ca to 3f5d4b9 Compare May 22, 2020 09:29
@gauravgahlot gauravgahlot reopened this May 22, 2020
@parauliya parauliya force-pushed the fix_fmt_lint_issue branch 5 times, most recently from 0793ccf to 69ab901 Compare May 22, 2020 11:08
@parauliya parauliya requested a review from mmlb May 22, 2020 11:18
@mmlb
Copy link
Contributor

mmlb commented May 22, 2020

@parauliya can you rebase instead of merge master in please? merge makes history messier.

@mmlb
Copy link
Contributor

mmlb commented May 22, 2020

Besides that :lgtm:

@parauliya parauliya force-pushed the fix_fmt_lint_issue branch from b0a237d to d0638bb Compare May 25, 2020 05:52
@parauliya
Copy link
Contributor Author

parauliya commented May 25, 2020

@parauliya can you rebase instead of merge master in please? merge makes history messier.

@mmlb , I rebased my branch to upstream/master.

@parauliya parauliya linked an issue May 25, 2020 that may be closed by this pull request
This commit has the following things
1. Fixed the goimports and golint issue in the current code.
2. Add check for goimports and golint issues in the CI pipeline
@parauliya parauliya force-pushed the fix_fmt_lint_issue branch from d0638bb to 8baa560 Compare May 25, 2020 11:23
@parauliya parauliya changed the title Fixed gofmt and golint issues Fixed gofmt and golint issues and added the check in CI May 25, 2020
Copy link
Contributor

@gauravgahlot gauravgahlot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gauravgahlot gauravgahlot merged commit a1cc6cf into tinkerbell:master May 26, 2020
@gauravgahlot gauravgahlot deleted the fix_fmt_lint_issue branch May 26, 2020 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make lint, vet and fmtcheck part of Makefile and part of CI run
3 participants