Skip to content

A config flag to run errcheck with the verbose flag #5800

@eteran

Description

@eteran

Welcome

How did you install golangci-lint?

Docker

Your feature request related to a problem? Please describe

There currently seems to be no way to run the errcheck linter with its verbose flag enabled. This is sometimes frustrating when trying to update the exclude list, because by default, there is no indication from the linter as to what specific package/type/function triggered the warning.

The difference is that without verbose mode the output looks like this:

Error return value of `io.Close` is not checked (errcheck)
        defer io.Close(ctx)

Which give a good hint, but it's still obtuse. was it triggered with a pointer receiver? Is it an interface and I need to exclude all possible things which satisfy the interface? Which package is it in? Which type is it? etc...

With verbose mode (running errcheck manually), i get this:

(*github.com/username/project/internal/mypackage.MyType).Close      defer io.Close(ctx)

Where that first bit is precisely what I'd want to add to my exclude list. I'd prefer not to have run errcheck manually to get this information.

Describe the solution you'd like

My proposal is to add:

  settings:
    errcheck:
        verbose: true

as an option to the .golangci.yaml file, and have it give the verbose output of the tool.

Describe alternatives you've considered

I currently manually re-run errcheck directly from the command line to get the information I need from the tool :-(.

Additional context

No response

Supporter

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