Skip to content

Commit

Permalink
add new go lint command that exludes default excluded rules
Browse files Browse the repository at this point in the history
  • Loading branch information
luv2code committed Jun 20, 2024
1 parent 6781c36 commit aad1cd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion after/ftplugin/go.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local ko = { buffer = true }

-- Go Tools
vim.keymap.set({"n", "v"}, "<leader>gl", ":GoLint<cr>", ko)
vim.keymap.set({"n", "v"}, "<leader>gl", ":GoLintEx<cr>", ko)
vim.keymap.set({"n", "v"}, "<leader>gm", ":GoRename<cr>", ko)
vim.keymap.set({"n", "v"}, "<leader>gt", ":GoFmt<cr>", ko)
vim.keymap.set({"n", "v"}, "<leader>gi", ":GoToggleInlay<cr>", ko)
Expand Down
4 changes: 4 additions & 0 deletions after/plugin/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ vim.api.nvim_create_autocmd("BufWritePre", {
group = format_sync_grp,
})

vim.cmd(
[[command! GoLintEx :setl makeprg=golangci-lint\ run\ --print-issued-lines=false\ --exclude-use-default=true\ --out-format=line-number | :GoMake]]
)

-- vim.api.nvim_create_autocmd("BufWritePre", {
-- pattern = { "*.templ" },
-- callback = function()
Expand Down

0 comments on commit aad1cd0

Please sign in to comment.