bufbuild / knit-go

Knit standalone gateway and Go embeddable gateway
Apache License 2.0
49 stars 2 forks source link

Add import aliases for packages whose name doesn't match import path #22

Closed zchee closed 1 year ago

zchee commented 1 year ago

For code readability.

jhump commented 1 year ago

Hi, @zchee, thanks for opening a pull request!

But I'm afraid the existing gci configuration is intentional. The current import grouping (just two groups) is consistent with other bufbuild repos (like bufbuild/buf and bufbuild/connect-go).

zchee commented 1 year ago

@jhump Ah, I see. That's the bufbuild code style. I respect it.

So, I changed PR about all: add import alias for not matched import path and package name, WDYT?

zchee commented 1 year ago

I think import alias also not bufbuild style. Close.

jhump commented 1 year ago

@zchee, sorry I didn't reply to this. I got pulled into something late last week and have been kind of heads down for a while. I was still considering this pull request. My main concern with merging it is that it won't last very long: as the code is edited and new imports are added, things will change and the aliases may be lost.

I think the intent is completely reasonable. But I also think we need some way to check/enforce it in CI if we want these aliases to be preserved over time. If there's a way to make golangci-lint enforce it, I'd be receptive to it.

zchee commented 1 year ago

@jhump Nop! and yes, golangci-lint has importas linter, which enforce strictly them.

I'll re-open PR with that later, Thanks!

zchee commented 1 year ago

@jhump PTAL

zchee commented 1 year ago

@jhump Thanks!!

zchee commented 1 year ago

@jhump Would you like to send this change to another repository by me?