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

Replace gometalinter with GolangCI-Lint #619

Merged
merged 2 commits into from
Jun 5, 2018

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented May 30, 2018

Running test.sh is down from 34s to 20s on my
machine.

Also, from now on, run go lint.

Signed-off-by: David Gageot david@gageot.net

@@ -91,8 +91,7 @@ func (a *LogAggregator) Start(ctx context.Context, client corev1.CoreV1Interface
return nil
}

// nolint: interfacer
func (a *LogAggregator) streamLogs(ctx context.Context, client corev1.CoreV1Interface, pod *v1.Pod) error {
func (a *LogAggregator) streamLogs(ctx context.Context, client corev1.PodsGetter, pod *v1.Pod) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Having this as a corev1interface instead of podsgetter was intentional, even though it failed linting.

Switching it gave me an error downstream. I don't think it would be covered by tests. I'll have to test it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean downstream? e2e tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep - i think the error I was thinking of was actually in wait.go where I had the nolint: interfacer. This LGTM

@dgageot dgageot force-pushed the golangci-lint branch 2 times, most recently from 615e025 to 92f15d3 Compare June 1, 2018 03:59
Running test.sh is down from 34s to 20s on my
machine.

Also, from now on, run go lint.

Signed-off-by: David Gageot <david@gageot.net>
@@ -91,8 +91,7 @@ func (a *LogAggregator) Start(ctx context.Context, client corev1.CoreV1Interface
return nil
}

// nolint: interfacer
func (a *LogAggregator) streamLogs(ctx context.Context, client corev1.CoreV1Interface, pod *v1.Pod) error {
func (a *LogAggregator) streamLogs(ctx context.Context, client corev1.PodsGetter, pod *v1.Pod) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep - i think the error I was thinking of was actually in wait.go where I had the nolint: interfacer. This LGTM

r2d4
r2d4 previously requested changes Jun 4, 2018
Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

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

oops this needs a rebase on master, I think some linting errors went in

@r2d4
Copy link
Contributor

r2d4 commented Jun 4, 2018

RUN hack/linter.sh
pkg/skaffold/build/local_test.go:66:16: struct of size 136 bytes could be of size 128 bytes (maligned)
        var tests = []struct {
                      ^
pkg/skaffold/kubernetes/wait_test.go:82:5: `podDifferentName` is unused (deadcode)
var podDifferentName = &v1.Pod{
    ^
pkg/skaffold/docker/image_test.go:40:2: `imageID` is unused (structcheck)
        imageID      string
        ^
pkg/skaffold/build/tag/date_time_test.go:26:6: type mockClock is unused (megacheck)
type mockClock struct {
     ^
FAILED hack/linter.sh

Signed-off-by: David Gageot <david@gageot.net>
@dgageot
Copy link
Contributor Author

dgageot commented Jun 5, 2018

@r2d4 I rebased and fixed the new errors. Let's merge!

@dgageot dgageot merged commit 98ad035 into GoogleContainerTools:master Jun 5, 2018
@dgageot dgageot deleted the golangci-lint branch June 6, 2018 06:51
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this pull request Sep 11, 2018
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

GoogleContainerTools/skaffold#619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this pull request Sep 11, 2018
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

GoogleContainerTools/skaffold#619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this pull request Sep 11, 2018
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

GoogleContainerTools/skaffold#619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this pull request Sep 11, 2018
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

GoogleContainerTools/skaffold#619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
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.

2 participants