Skip to content

Allow specifying golangci-lint custom output path as argument #5369

Closed
@lukasschwab

Description

@lukasschwab

Welcome

Your feature request related to a problem? Please describe

Currently golangci-lint custom write the resulting custom binary to

  1. The destination and name specified in .custom-gcl.yml or equivalent.
  2. ./custom-gcl by default.

When building a generic harness for custom linters — one where users bring their own .custom-gci.yml files — I want to write a script that builds a custom linter and then invokes it, regardless of the destination and name specified in YAML.

Describe the solution you'd like

I want to be able to specify an output location with a command-line argument. For example, I'd like to run

$ golangci-lint custom -v -o ./freshly-built-linter
$ ./freshly-built-linter run

This can behave analagously to the -o output argument on go build: if present, override the settings in YAML.

usage: go build [-o output] [build flags] [packages]

Describe alternatives you've considered

  • Requiring an implicit correspondence between arguments to my program and the contents (name, destination) of a user's .custom-gcl.yml file.
  • Parsing the .custom-gcl.yml files in my scripts to extract name and destination, to recreate the path to the build target.

Additional context

No response

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions