Skip to content

intrange lacks a preset #4795

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

Closed
2 of 3 tasks
Inuart opened this issue Jun 6, 2024 · 3 comments · Fixed by #4797
Closed
2 of 3 tasks

intrange lacks a preset #4795

Inuart opened this issue Jun 6, 2024 · 3 comments · Fixed by #4797
Labels
enhancement New feature or improvement

Comments

@Inuart
Copy link
Contributor

Inuart commented Jun 6, 2024

Welcome

Your feature request related to a problem? Please describe

intrange is the only linter that's not a part of a preset.

I'm using presets to be able to enable all linters and automatically deal with new and deprecated linters, but after adding all the available presets, the intrage linter is still disabled.

Describe the solution you'd like

intrange is added to one or more presets

Describe alternatives you've considered

enabling it specifically, but since it's the only one, that's weird.

Additional context

No response

Supporter

@Inuart Inuart added the enhancement New feature or improvement label Jun 6, 2024
Copy link

boring-cyborg bot commented Jun 6, 2024

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Jun 6, 2024

Hello,

A preset can be added here:

linter.NewConfig(intrange.New()).
WithSince("v1.57.0").
WithURL("https://github.com/ckaznocha/intrange").
WithNoopFallback(cfg, linter.IsGoLowerThanGo122()),

The file assets/linters-info.json will be modified, this file will be updated automatically when we create a new release.

The preset can be "style" as you suggested.

Note: your hack is a bit obsolete with the new deprecation cycle of the linters.
https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle

@Inuart
Copy link
Contributor Author

Inuart commented Jun 6, 2024

Note: your hack is a bit obsolete with the new deprecation cycle of the linters.
https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle

But I still have to manually disable it / see a warning right?

A preset can be added here:

golangci-lint/pkg/lint/lintersdb/builder_linter.go

I've created another PR modifying this #4797. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
2 participants