daixiang0 / gci

GCI, a tool that control golang package import order and make it always deterministic.
BSD 3-Clause "New" or "Revised" License
433 stars 62 forks source link

Cannot run GCI with -s localmodule flag #193

Closed F0rzend closed 8 months ago

F0rzend commented 8 months ago

What version of GCI are you using?

v0.13.0

Reproduce Steps

I run from root of my project with relative path to the file: image

What did you expect to see?

Successfully formatted file

What did you see instead?

Error: error reading local packages: [-: no Go files in ]

daixiang0 commented 8 months ago

@F0rzend could you share a case as simple as possible to reproduce it?

CarlosRDomin commented 8 months ago

Same here 😭
I'll try to share a minimum reproducible example tomorrow if @F0rzend doesn't beat me to it :)

petr-korobeinikov commented 8 months ago

👋

192 should solve problem above.

petr-korobeinikov commented 8 months ago

Looking forward to see a minimal example...

matthewhughes934 commented 8 months ago

Has this issue been raised with golangci-lint? I ask because it might be a blocker for releasing this feature upstream and I see gci has already been updated (but not included in any release) to include the change with https://github.com/golangci/golangci-lint/commit/9c492afc8396d16bb640661afecf8e2968f04c60. That is, it might be worth reverting that change if it's not certain a fix will be available in time for whenever golangci-lint plans on making their next release

EDIT: I mentioned it on the #golangci-lint slack channel

CarlosRDomin commented 8 months ago

Apologies, it's been a busy week. I haven't had enough time to provide a minimum reproducible example but I can confirm that https://github.com/daixiang0/gci/pull/192 fixes the problems with my repo and everything works as expected!! Thank you so much @petr-korobeinikov for your great work, also the new tests look great :)