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

Correct import order #321

Merged
merged 1 commit into from
Aug 27, 2019

Conversation

ferhatelmas
Copy link
Contributor

https://github.com/kubernetes-sigs/krew/blob/master/.golangci.yml#L6 wasn't applied correctly.

This PR fixes existing issues but the root cause is still there. Since golangci-lint won't be fixed soon. I suggest integrating impi in the short run (as a follow up PR or update on this)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 27, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 27, 2019
@codecov-io
Copy link

codecov-io commented Aug 27, 2019

Codecov Report

Merging #321 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #321   +/-   ##
======================================
  Coverage    57.3%   57.3%           
======================================
  Files          19      19           
  Lines         904     904           
======================================
  Hits          518     518           
  Misses        335     335           
  Partials       51      51
Impacted Files Coverage Δ
pkg/installation/move.go 32.06% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbfcd95...7cc06a5. Read the comment docs.

@corneliusweig
Copy link
Contributor

Hey thanks for bringing this up! This is indeed an annoying loophole in the current rules. Let's merge this now and evaluate impi in a separate PR.

Do you happen to know the golangci-lint issue which tracks this bug?
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 27, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: corneliusweig, ferhatelmas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2019
@k8s-ci-robot k8s-ci-robot merged commit 555b305 into kubernetes-sigs:master Aug 27, 2019
@ahmetb
Copy link
Member

ahmetb commented Aug 27, 2019

This might be because I did some refactoring in Goland IDE, which does a surprisingly poor job organizing imports.

@corneliusweig
Copy link
Contributor

corneliusweig commented Aug 27, 2019

Yes, goland is not great at this. But ultimately, it should be the job of goimports to set it right. My annoying workaround is currently to put all imports into one single block and then run goimports.

@ferhatelmas
Copy link
Contributor Author

Actually, it's not a golangci-lint issue but goimports.

Canonical issue: golang/go#20818
A failed attempt to fix it: mvdan/gofumpt#8

Also there are various complaints in golangci-lint but there are mostly irrelevant, not being the root cause. That's why I didn't link them, here.

impi is simple since it doesn't format but only validates. When we keep imports consistent and get alerted on wrong order, fixing should be easy then sounds good enough to me.

Green light for impi integration?

@ferhatelmas ferhatelmas deleted the fix-import-order branch August 27, 2019 21:56
@corneliusweig
Copy link
Contributor

I'd say yes, let's try this out!

@ferhatelmas ferhatelmas mentioned this pull request Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants