Feature Area
Other
Problem Statement
There should be something checking that Go imports are in canonical order and grouping. It should be easy for a contributor to put the Go imports in a file into canonical order and grouping.
Canonical grouping is the following groups, in this order.
- Imports from Go's stdlib.
- Imports of packages that are independent of Kubernetes.
- Imports of Kubernetes packages.
- Imports of dependencies that depend on Kubernetes.
- Imports from other llm-d repos (there are none of these, so far).
- Imports of other packages in this repo.
Within each group, imports should be in lexicographic order.
Proposed Solution
CI should include a gating check of this.
We should publish recommendations for how contributors establish, or at least check, compliance before submitting a PR.
Alternatives Considered
No response
Willingness to Contribute
Yes, I can submit a PR
Additional Context
The standard tools gofmt and goimports do ordering within the groups.
goimports -local will handle three groups, not the five that we want.
I usually use VS Code, which is maintaining order within the groups but does not do anything about proper grouping. I find that not terribly difficult to do by hand.
Feature Area
Other
Problem Statement
There should be something checking that Go imports are in canonical order and grouping. It should be easy for a contributor to put the Go imports in a file into canonical order and grouping.
Canonical grouping is the following groups, in this order.
Within each group, imports should be in lexicographic order.
Proposed Solution
CI should include a gating check of this.
We should publish recommendations for how contributors establish, or at least check, compliance before submitting a PR.
Alternatives Considered
No response
Willingness to Contribute
Yes, I can submit a PR
Additional Context
The standard tools
gofmtandgoimportsdo ordering within the groups.goimports -localwill handle three groups, not the five that we want.I usually use VS Code, which is maintaining order within the groups but does not do anything about proper grouping. I find that not terribly difficult to do by hand.