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

re-order the import package #987

Merged
merged 1 commit into from
Nov 30, 2015
Merged

re-order the import package #987

merged 1 commit into from
Nov 30, 2015

Conversation

carmark
Copy link
Contributor

@carmark carmark commented Nov 30, 2015

Make sure the import package in each file as the follow order:

  • golang self package
  • cadvisor package
  • third-party package

@cadvisorJenkinsBot
Copy link
Collaborator

Can one of the admins verify this patch?

@jimmidyson
Copy link
Collaborator

Thanks for the PR. Did you do this manually or via a tool like goimports? If via a tool then can we also get the check added to the build scripts to verify subsequent PRs don't mess up ordering?

@carmark
Copy link
Contributor Author

carmark commented Nov 30, 2015

@jimmidyson

I read the code, and modify the import packages manually at the same time. The tool goimports seems not working for this change.

@jimmidyson
Copy link
Collaborator

Why do you feel strongly about this package order? What different order does goimports produce? My issue with manually doing this is keeping it ordered going forward. Need tooling to support.

@carmark
Copy link
Contributor Author

carmark commented Nov 30, 2015

This order make the packages imported very clear, the tool goimports will only separate the golang packages and other packages into two parts. However, the order of this patch will have another parts.

It is truly that there is no any tool to support this, and I do not very strongly feel this patch is very necessary, but kubernetes uses this kind of order.

@jimmidyson
Copy link
Collaborator

OK that makes sense.

Going to have to keep a close eye on import order in future.

Thanks!

@jimmidyson
Copy link
Collaborator

ok to test

@jimmidyson
Copy link
Collaborator

Merging as the integration testing environment is broken, but this change only affects import order & unit tests pass.

jimmidyson added a commit that referenced this pull request Nov 30, 2015
re-order the import package
@jimmidyson jimmidyson merged commit 61246be into google:master Nov 30, 2015
@jimmidyson
Copy link
Collaborator

Thanks @carmark.

@carmark
Copy link
Contributor Author

carmark commented Nov 30, 2015

Thanks @jimmidyson. I will also try to keep a close eye on the new import packages.

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.

3 participants