golangci / golangci-lint

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

Cannot change settings disabled by default in staticcheck and stylecheck to enabled #5043

Closed taniguchi-yoshiki11 closed 1 month ago

taniguchi-yoshiki11 commented 1 month ago

Welcome

Description of the problem

I want to enable ST1020 and ST1021 in staticcheck or stylecheck settings. However, those settings cannot be activated.

It is a valid setting if it is from staticheck's CLI. staiticcheck ./...

Version of golangci-lint

```console $ golangci-lint --version golangci-lint has version 1.61.0 built with go1.23.1 from a1d6c56 on 2024-09-09T14:33:19Z ```

Configuration

```console linters-settings: staticcheck: checks: ["all", "-ST1000"] stylecheck: checks: ["all", "-ST1000"] ```

Go environment

Go1.23.1

Verbose output of running

not relevant

A minimal reproducible example or link to a public repository

not relevant

Validation

Supporter

boring-cyborg[bot] commented 1 month ago

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

ldez commented 1 month ago

Hello,

Those rules are disabled by default, you must disable default exclusions.

https://golangci-lint.run/usage/false-positives/#default-exclusions

linters-settings:
  staticcheck:
    checks: ["all", "-ST1000"]
  stylecheck:
    checks: ["all", "-ST1000"]

issues:
  exclude-use-default: false