Skip to content

Conversation

@azdanov
Copy link
Contributor

@azdanov azdanov commented Apr 12, 2025

📑 Description

This pack adds golangci-lint support using the golangci-lint-langserver.

ℹ Additional Information

Not sure If it needs to be backwards compatible between golangci-lint v1 and v2. Also not sure about AstroNvim v4 and v5. So it just uses latest version of all and requires astro v5.

A custom lsp config override is needed, but it seems to work fine nametake/golangci-lint-langserver#51

@github-actions
Copy link

github-actions bot commented Apr 12, 2025

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

Copy link
Member

@Uzaaft Uzaaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add this into the go pack?

@azdanov
Copy link
Contributor Author

azdanov commented Apr 12, 2025

Can be. I thought to keep it modular. Not entirely sure how common this tool is in the Go world. As an example ESlint is kind of a standard at this point in js/ts.

@ALameLlama
Copy link
Member

If this one is dependent of the go pack maybe this one should import it so users don't need to do

{ import = "astrocommunity.pack.go" },
{ import = "astrocommunity.pack.golangci-lint " }

I also can't see a linter in the current go pack but I assume this is built into another tool. I'm not that familiar with the go eco system.

@azdanov
Copy link
Contributor Author

azdanov commented Apr 16, 2025

That's a good idea to bundle them together. I was playing around with a more modular design approach to community packs.

If there are no hard dependencies between them then maybe it's better not to hardcore and let the people choose. To help avoid mega packs like typescript.

In this case it does make sense since why would anyone use it without a go pack.

@azdanov azdanov force-pushed the add-golangci-lint branch from 1e61e72 to c9148bf Compare April 17, 2025 07:20
@azdanov
Copy link
Contributor Author

azdanov commented Apr 17, 2025

I also can't see a linter in the current go pack but I assume this is built into another tool. I'm not that familiar with the go eco system.

gopls (lsp) has some linting built in that's quite good. This just adds a lot of community tooling that are out there. As an example can check out this config: https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322
But by default it only adds a few to keep it simple: https://golangci-lint.run/usage/linters/#enabled-by-default

@Uzaaft Uzaaft merged commit 70156aa into AstroNvim:main Apr 18, 2025
16 checks passed
@azdanov azdanov deleted the add-golangci-lint branch April 26, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants