golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
15.43k stars 1.38k forks source link

intrange lacks a preset #4795

Closed Inuart closed 3 months ago

Inuart commented 3 months ago

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

boring-cyborg[bot] commented 3 months ago

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

ldez commented 3 months ago

Hello,

A preset can be added here: https://github.com/golangci/golangci-lint/blob/4e53f51c4ec2752844ba45bd75efcb57f9f4ba4d/pkg/lint/lintersdb/builder_linter.go#L508-L511

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 commented 3 months ago

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 https://github.com/golangci/golangci-lint/pull/4797. Thanks!