mvdan / gofumpt

A stricter gofmt
https://pkg.go.dev/mvdan.cc/gofumpt
BSD 3-Clause "New" or "Revised" License
3.33k stars 112 forks source link

gofumpt conflicts with goimports-reviser based import formatting. #272

Closed krishnamiriyala closed 1 year ago

krishnamiriyala commented 1 year ago

Can we add an option to skip formatting imports or sort only within the sections of import instead fo the whole list being sorted even if they are separated by spaces?

sample,

package testdata // goimports-reviser/testdata

import (
    "fmt" // fmt package

    "golang.org/x/exp/slices" // custom package

    "github.com/incu6us/goimports-reviser/pkg" // this is a company package which is not a part of the project, but is a part of your organization

    "goimports-reviser/pkg"
)

goes back to after running gofumpt

package testdata // goimports-reviser/testdata

import (
    "fmt" //fmt package
    "golang.org/x/exp/slices" //custom package
    "github.com/incu6us/goimports-reviser/pkg" // this is a company package which is not a part of the project, but is a part of your organization
    "goimports-reviser/pkg"
)
krishnamiriyala commented 1 year ago

not seein on latest this issue, will reopen with proper details if found again.