Skip to content

consider the main module path when grouping imports #187

@glightfoot

Description

@glightfoot

I know this has been discussed before, but it would be EXTREMELY useful to have an option to disable gofumpt's import sorting. We have an old go codebase that does not have a dot in the module name, and this makes gofumpt unusable for us. While the spec makes sense, changing it is not possible at this time. Additionally, we have extra import grouping rules beyond the local prefix that we would like to not lose.

Gofumpt is the best formatter I've found, and the integration with golangci-lint and autofix would be massively useful if we could just disable import sorting and use our own. It sounds like many people are in the same boat, and adding the option would make gofumpt more useful for everyone.

I'm willing to make the PR to add the option if that helps.

Thanks for making such a wonderful tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions