Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(go): Add golangcilint as default linter #1213

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

shivanthzen
Copy link
Contributor

@shivanthzen shivanthzen commented Sep 19, 2024

📑 Description

The PR adds golangcilint as the default linter for go.pack. Currently no linters as part for the pack.

ℹ Additional Information

Copy link

github-actions bot commented Sep 19, 2024

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).

@shivanthzen shivanthzen changed the title [feat: pack.go] Add golangci as default linter feat(pack.go) Add golangci as default linter Sep 19, 2024
@shivanthzen shivanthzen changed the title feat(pack.go) Add golangci as default linter feat(pack.go): Add golangcilint as default linter Sep 19, 2024
@shivanthzen shivanthzen changed the title feat(pack.go): Add golangcilint as default linter feat(go): Add golangcilint as default linter Sep 19, 2024
@shivanthzen shivanthzen marked this pull request as ready for review September 19, 2024 21:14
@shivanthzen
Copy link
Contributor Author

Thanks for the revision
LGTM.

@mehalter mehalter merged commit 2467e24 into AstroNvim:main Sep 20, 2024
14 checks passed
@zedeus
Copy link
Contributor

zedeus commented Sep 20, 2024

For me it doesn't get updated in real-time unlike gopls which already uses e.g. staticcheck for linting. It results in both lingering and duplicated warnings for me:
After save:
image
After satisfying the check, before saving:
image

I'd like either of the following options:

  • Improve the golangcilint integration to be real-time without having to edit just like the default LSP is (maybe by using null-ls instead of nvim-lint? I don't know very much about plugin landscape so maybe this is nonsensical)
  • A way to easily disable golangcilint (not sure how to go about it, do I have to remove that element from the array in my configuration?)

@mehalter
Copy link
Member

@zedeus yeah it might be better for this not to be a default is gopls already has linting. Then users can opt into it. If you open a PR to revert this then I will merge it

@zedeus
Copy link
Contributor

zedeus commented Sep 20, 2024

@mehalter here you go: #1215

mehalter pushed a commit that referenced this pull request Sep 20, 2024
Revert 'feat(go): Add golangcilint as default linter (#1213)'

2467e24 'feat(go): Add golangcilint as default linter (#1213)'
@shivanthzen
Copy link
Contributor Author

shivanthzen commented Sep 23, 2024

The revert makes sense.
Is A way to easily disable golangci_lint (not sure how to go about it, do I have to remove that element from the array in my configuration?) this a possbility right now in Astronvim ? Can I override pack configurations ? I only know of override.lua which is sort of per plugin configuration.
@mehalter

@mehalter
Copy link
Member

yeah you can revert the decision in your user configuration. You would just modify the configuration of the plugins. So go into the opts for nvim-lint for example and remove golangci_lint from the go filetype list

@mehalter
Copy link
Member

you can add it anywhere in your plugins/ folder. It doesn't have to go in override.lua

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