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

add additional linter & dotimportwhitelist #115

Closed
wants to merge 1 commit into from
Closed

Conversation

IvoGoman
Copy link
Contributor

@IvoGoman IvoGoman commented Sep 20, 2023

A number of projects I am working on use Ginkgo and Gomega for writing tests.
Usually Ginkgo and Gomega are dot imported, which is flagged by the stylecheck linter.
So I have to manually exclude the paths for these two libs in the .golangci.yaml:

stylecheck:
  dot-import-whitelist:
    - github.com/onsi/ginkgo/v2
    - github.com/onsi/gomega

Also I am enabling the ginkgolinter, which provides some valuable suggestions for the usage of ginkgo.

I would like to be able to specify this in the Makefile.maker.yaml, as currently I have to remember to re-add these configurations after running go-makefile-maker.

Since not every Go project is using these two libraries for testing, I was hesitant to add the configuration as a default to the .golangci.yaml template.
Another option I considered was adding a ginkgo/gomega specific option to the config to add these configurations if that option is set. But this would be very specific and the individual flags allow others use-cases as well.

New config field additionalLinters to add linters for specific needs
New config field dotImportWhitelist to exclude specific libraries from dot import linter
@majewsky
Copy link
Contributor

I don't think these two changes need to be opt-in. Can you please make a PR that just straight up adds these changes to our main .golangci.yaml template?

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.

2 participants