golangci-lint
golangci-lint copied to clipboard
Add `prefix-current-module` to goimports
I'd like to add a bool option prefix-current-module
to the goimports config.
It would basically check if the linted package is a module, and slap the module path (based on go.mod
if exists) to the list of local prefixes. It would make the configuration more portable.
WDYT?
Thank you for idea, seems reasonable. Feel free to open PR.
@ernado are you aware of any tools that detect module paths in GolangCI?
If not, I would pull in https://github.com/gobuffalo/here as a dependency. It doesn't have any additional dependencies that's not already a dependency in GolangCI.
I think that package name should be already in analysis context, but I'm not sure.
The package name is not enough, I need the root module path and as far as I can tell, it's not available in the context.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sadly, I haven't beeb able to work on it, but it'd still be a good feature.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.