Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new output.formats file configuration syntax #4521

Merged
merged 9 commits into from Mar 18, 2024

Conversation

ldez
Copy link
Member

@ldez ldez commented Mar 17, 2024

This PR improves the syntax inside the configuration file to specify output formats.

The previous syntax has been defined when only the format type was an option.
However, the syntax has evolved to support output paths and multiple formats.

output:
  format: "checkstyle:report.xml,json:stdout,colored-line-number"

This is a flag syntax friendly but not a file syntax friendly.

I propose this new syntax:

output:
  formats:
    - format: checkstyle
      path: report.xml
    - format: json
      path: stdout
    - format: colored-line-number

The CLI flag keeps the same syntax.

--out-format=checkstyle:report.xml,json:stdout,colored-line-number

To keep this new option compatible with the GitHub Action, the CLI must override the configuration file.

The previous field output.format is deprecated and works as before but with a warning.

@ldez ldez added enhancement New feature or improvement area: config Related to .golangci.yml and/or cli options area: output Related to issue output labels Mar 17, 2024
@ldez ldez added this to the next milestone Mar 17, 2024
@ldez ldez marked this pull request as draft March 17, 2024 10:52
@ldez ldez marked this pull request as ready for review March 17, 2024 11:11
pkg/config/output.go Outdated Show resolved Hide resolved
.golangci.next.reference.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@Antonboom Antonboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

pkg/config/output.go Outdated Show resolved Hide resolved
pkg/config/output_test.go Show resolved Hide resolved
ldez and others added 2 commits March 18, 2024 13:10
Co-authored-by: Anton Telyshev <anton.telishev@yandex.ru>
@ldez ldez merged commit e3ed3ba into golangci:master Mar 18, 2024
12 checks passed
@ldez ldez deleted the feat/output-formats branch March 18, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to .golangci.yml and/or cli options area: output Related to issue output enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants