Skip to content

Provide machine-parseable version output #1314

Closed
@porridge

Description

@porridge

Is your feature request related to a problem? Please describe.

Automatically checking the available tool version is hacky and fragile, as seen in the examples below. This is because the output of golangci-lint --version is mean for human rather than machine consumption.

Describe the solution you'd like

Something easy to parse in a shell script. The piece that would make us happy would be:

$ golangci-lint --version-string
v1.777.0

If other pieces are also needed, one could also imagine:

$ golangci-lint --version-mod-sum
h1:HxAxpR8Z0M8omihvQdsD3PF0qPjlqYqp2vMJzstoKeI=

Describe alternatives you've considered

One could also imagine --version --json that would produce structured output, but that is not so easy to use in a shell script without additional tools (jq).

The output for --version could be changed without introducing another flag, but that would break backwards compatibility.

Additional context

Some projects try to ensure that the version of golangci-lint they use is consistent for all developers (example, another).

Metadata

Metadata

Assignees

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