incu6us / goimports-reviser

Right imports sorting & code formatting tool (goimports alternative)
MIT License
607 stars 72 forks source link

Add "dotted" and "blank" imports to imports order #104

Closed F0rzend closed 1 year ago

F0rzend commented 1 year ago

It would be nice if the aliased imports . and _ were grouped separately.

Example from gci:

from

package main
import (
  "fmt"
  go "github.com/golang"
  _ "github.com/golang/blank"
  . "github.com/golang/dot"
  "github.com/daixiang0/gci"
  _ "github.com/daixiang0/gci/blank"
  . "github.com/daixiang0/gci/dot"
)

to

package main
import (
  "fmt"

  go "github.com/golang"

  "github.com/daixiang0/gci"

  _ "github.com/daixiang0/gci/blank"
  _ "github.com/golang/blank"

  . "github.com/daixiang0/gci/dot"
  . "github.com/golang/dot"
)
incu6us commented 1 year ago

Version 3.5.5 contains the feature. Now, you need to set -imports-order std,general,company,project,blanked,dotted to have additional groups for blanked and dotted imports