golangci / golangci-lint-action

Official GitHub Action for golangci-lint from its authors
https://github.com/marketplace/actions/golangci-lint
MIT License
1.1k stars 152 forks source link

github-actions is deprecated warning #1081

Closed stevenh closed 3 months ago

stevenh commented 3 months ago

Welcome

Description of the problem

When reporting a failure golangci-lint reports a deprication warning for a config option that isn't present:

Running [/home/runner/golangci-lint-1.59.1-linux-amd64/golangci-lint run --out-format=colored-line-number,github-actions] in [] ...
  Error: test.go:19:12: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
  type testConfig struct {
             ^
  Error: fieldalignment: struct with 16 pointer bytes could be 8 (govet)

  level=warning msg="[config_reader] The output format `github-actions` is deprecated, please use `colored-line-number`"

  Error: issues found
  Ran golangci-lint in [40](...)15ms

Our config includes --out-format=colored-line-number but not github-actions which seems to be being append automatically by the action?

Version of golangci-lint

1.59.1

Version of the GitHub Action

v4

Workflow file

```yml - name: Go Lint uses: golangci/golangci-lint-action@v4 with: version: ${{ env.GOLANGCI_VERSION }} args: --out-format=colored-line-number skip-pkg-cache: true skip-build-cache: true ```

Golangci-lint configuration

```yml run: timeout: 2m linters-settings: gosec: excludes: - G601 ## Implicit memory aliasing of items from a range statement - not possible in go 1.22. cyclop: max-complexity: 15 nestif: min-complexity: 10 govet: settings: shadow: strict: true enable-all: true mnd: ignored-functions: - '^make$' # Configuring a slice or map with a capacity is fine. - '^strings.SplitN$' # We don't care about the number of splits. nolintlint: require-explanation: true godot: scope: all linters: enable-all: true disable: # Spammy / low value - varnamelen - exhaustruct - nlreturn - wsl - lll - paralleltest # Duplicate functionality. - funlen - gocognit # Deprecated. - execinquery - gomnd # Good but gets in the way too often. - testpackage # Unknown details about how Artemis works are flagged with TODO's. - godox # Seems to be broken. - depguard # Makes it messy for multiple optional tags. - tagalign # Not needed for go 1.22+. - exportloopref - canonicalheader # TODO: Enable after we correct the header specification. - errchkjson # Duplicate functionality for errcheck. issues: include: - EXC0012 - EXC0014 exclude-rules: # Exclude linters which aren't an issue in tests. - path: _test\.go linters: - gochecknoglobals - wrapcheck # File mode permissions are fine for constants. - text: "Magic number: 0o\\d+" linters: - mnd # Field alignment in tests isn't a performance issue. - text: fieldalignment path: _test\.go # Dynamic errors can provide useful context. - text: "do not define dynamic errors, use wrapped static errors instead:" linters: - err113 # We need replacements to ensure plugins are compatible with KrakenD. - text: "replacement are not allowed:" linters: - gomoddirectives ```

Go version

1.22.5

Code example or link to a public repository

```go type testConfig struct { int1 int string1 string int2 int } ```
ldez commented 3 months ago

Hello,

you are using v4 of the GitHub Action, you should use v6.

https://github.com/golangci/golangci-lint-action/releases/tag/v6.0.0