Skip to content

gocritic: improve confusing error message #950

Closed
@martinsirbe

Description

@martinsirbe

Thank you for creating the issue!

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.23.1 built from 567904e on 2020-01-20T08:00:15Z
Config file
$ cat .golangci.yml
linters-settings:
  gocritic:
    disabled-checks:
    - whyNoLint
Go environment Not relevant...
Verbose output of running
$ golangci-lint run -v
level=info msg="[config_reader] Used config file .golangci.yaml"
level=warning msg="Gocritic check \"whyNoLint\" was disabled by config, was it's not enabled, no need to disable it"

Issue

I got the following error message:

Gocritic check \"whyNoLint\" was disabled by config, was it's not enabled, no need to disable it

Based on this:

log.Warnf("Gocritic check %q was disabled by config, was it's not enabled, no need to disable it",

I'm not sure what exactly does "was it's not enabled" mean, can this be clarified?
Furthermore, could this be improved with steps which indicates how this error can be fixed, if this even counts as an error in the first place?

This should probably read something like:

Gocritic check \"whyNoLint\" was disabled by config, but this check is already disabled by default, therefore there is no need to explicitly disable it via config again.

That's if I understand correctly what's the issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions