Skip to content

Commit

Permalink
feat: add goimports-reviser (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
laytan authored Sep 11, 2022
1 parent 364dd14 commit 6a2b45b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions lua/mason-registry/goimports-reviser/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local Pkg = require "mason-core.package"
local _ = require "mason-core.functional"
local go = require "mason-core.managers.go"

return Pkg.new {
name = "goimports-reviser",
desc = _.dedent [[
Tool for Golang to sort goimports by 3-4 groups: std, general, company (optional), and project dependencies.
Also, formatting for your code will be prepared (so, you don't need to use gofmt or goimports separately).
Use additional option -rm-unused to remove unused imports and -set-alias to rewrite import aliases for
versioned packages.
]],
homepage = "https://pkg.go.dev/github.com/incu6us/goimports-reviser",
categories = { Pkg.Cat.Formatter },
languages = { Pkg.Lang.Go },
install = go.packages { "github.com/incu6us/goimports-reviser", bin = { "goimports-reviser" } },
}
1 change: 1 addition & 0 deletions lua/mason-registry/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ return {
["go-debug-adapter"] = "mason-registry.go-debug-adapter",
gofumpt = "mason-registry.gofumpt",
goimports = "mason-registry.goimports",
["goimports-reviser"] = "mason-registry.goimports-reviser",
["golangci-lint"] = "mason-registry.golangci-lint",
["golangci-lint-langserver"] = "mason-registry.golangci-lint-langserver",
golines = "mason-registry.golines",
Expand Down
2 changes: 1 addition & 1 deletion lua/mason/mappings/language.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ return {
flux = { "flux-lsp" },
fortran = { "fortls" },
gitcommit = { "gitlint" },
go = { "delve", "djlint", "go-debug-adapter", "gofumpt", "goimports", "golangci-lint", "golangci-lint-langserver", "golines", "gomodifytags", "gopls", "gotests", "impl", "json-to-struct", "revive", "staticcheck" },
go = { "delve", "djlint", "go-debug-adapter", "gofumpt", "goimports", "goimports-reviser", "golangci-lint", "golangci-lint-langserver", "golines", "gomodifytags", "gopls", "gotests", "impl", "json-to-struct", "revive", "staticcheck" },
graphql = { "graphql-language-service-cli", "prettier", "prettierd" },
groovy = { "groovy-language-server" },
haml = { "haml-lint" },
Expand Down

0 comments on commit 6a2b45b

Please sign in to comment.