mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-20 01:14:38 +00:00
Add option to configure additional output format
This commit is contained in:
parent
f3c064d740
commit
7d26dd30b9
3 changed files with 12 additions and 1 deletions
|
|
@ -57,6 +57,9 @@ jobs:
|
|||
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
||||
# only-new-issues: true
|
||||
|
||||
# Optional: render results of golangci-lint additionally into a file; syntax: <format>:<file_path> (see also https://golangci-lint.run/usage/configuration/#output-configuration)
|
||||
# output-file: checkstyle:golangci_lint.xml
|
||||
|
||||
# Optional: if set to true then the all caching functionality will be complete disabled,
|
||||
# takes precedence over all other caching options.
|
||||
# skip-cache: true
|
||||
|
|
@ -115,6 +118,9 @@ jobs:
|
|||
|
||||
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
||||
# only-new-issues: true
|
||||
|
||||
# Optional: render results of golangci-lint additionally into a file; syntax: <format>:<file_path> (see also https://golangci-lint.run/usage/configuration/#output-configuration)
|
||||
# output-file: checkstyle:golangci_lint.xml
|
||||
```
|
||||
|
||||
You will also likely need to add the following `.gitattributes` file to ensure that line endings for windows builds are properly formatted:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ inputs:
|
|||
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
|
||||
default: false
|
||||
required: true
|
||||
output-file:
|
||||
description: "render results of golangci-lint additionally into a file; syntax: <format>:<file_path> (see also https://golangci-lint.run/usage/configuration/#output-configuration)"
|
||||
required: false
|
||||
skip-cache:
|
||||
description: |
|
||||
if set to true then the all caching functionality will be complete disabled,
|
||||
|
|
|
|||
|
|
@ -130,7 +130,9 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
|||
if (userArgNames.has(`out-format`)) {
|
||||
throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`)
|
||||
}
|
||||
addedArgs.push(`--out-format=github-actions`)
|
||||
|
||||
const outputFile = core.getInput(`output-file`, { required: false }).trim()
|
||||
addedArgs.push(`--out-format=github-actions${outputFile ? ',' + outputFile : ''}`)
|
||||
|
||||
if (patchPath) {
|
||||
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue