Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lua/astrocommunity/pack/golangci-lint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# golangci-lint

Fast linters runner for Go.

This plugin pack integrates [golangci-lint](https://golangci-lint.run/) into your AstroNvim setup using the [golangci-lint-langserver](https://github.com/nametake/golangci-lint-langserver).

**Features:**

- Supports a wide range of linters to catch common errors and improve code quality.
- Automatically installs `golangci-lint-langserver` via Mason.
- Provides lint diagnostics directly in your editor using `golangci-lint`.
- Runs `golangci-lint` efficiently in the background.

**Note:** This pack imports the Go language pack (`astrocommunity.pack.go`) for a complete Go development environment.
34 changes: 34 additions & 0 deletions lua/astrocommunity/pack/golangci-lint/golangci-lint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---@type LazySpec
return {
{ import = "astrocommunity.pack.go" },
{
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
---@diagnostic disable: missing-fields
config = {
-- Overrides the default config to support golangci-lint v2
golangci_lint_ls = {
init_options = {
command = {
"golangci-lint",
"run",
"--output.json.path",
"stdout",
"--show-stats=false",
"--issues-exit-code=1",
},
},
},
},
},
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed =
require("astrocore").list_insert_unique(opts.ensure_installed, { "golangci-lint-langserver" })
end,
},
}