Skip to content

The action fails validation on custom linters configuration #1179

New issue

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

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

Already on GitHub? # to your account

Closed
3 tasks done
andersroos opened this issue Feb 17, 2025 · 6 comments
Closed
3 tasks done

The action fails validation on custom linters configuration #1179

andersroos opened this issue Feb 17, 2025 · 6 comments
Assignees
Labels
area: verify bug Something isn't working

Comments

@andersroos
Copy link

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

Hi,

We use custom linters and our golangci-lint action just started failing with validation errors on .golangci.yaml.

The message we get is:

Error: Failed to run: Error: Command failed: /home/runner/go/bin/golangci-lint config verify
38
jsonschema: "linters-settings.custom.connecterr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
39
jsonschema: "linters-settings.custom.clouderr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
40
jsonschema: "linters-settings.custom.translatedstring" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
41
Failed executing command with error: the configuration contains invalid elements
42
, Error: Command failed: /home/runner/go/bin/golangci-lint config verify
43
jsonschema: "linters-settings.custom.connecterr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
44
jsonschema: "linters-settings.custom.clouderr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
45
jsonschema: "linters-settings.custom.translatedstring" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
46
Failed executing command with error: the configuration contains invalid elements
47

48
    at genericNodeError (node:internal/errors:984:15)
49
    at wrappedFn (node:internal/errors:538:14)
50
    at ChildProcess.exithandler (node:child_process:422:12)
51
    at ChildProcess.emit (node:events:519:28)
52
    at maybeClose (node:internal/child_process:1105:16)
53
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
54
Error: Command failed: /home/runner/go/bin/golangci-lint config verify
55

Could maybe be related to this one as turning off validating made it start working again: #1171

Version of golangci-lint

v1.63.4

Version of the GitHub Action

v6

Workflow file

  lint:
    steps:
      - uses: golangci/golangci-lint-action@v6
        with:
          version: v1.63.4
          args: --timeout 3m0s
          skip-pkg-cache: true
          skip-build-cache: true
          install-mode: "goinstall"

Golangci-lint configuration

run:
  go: "1.23.5"

linters:
  enable:
    - errcheck
    - gosimple
    - govet
    - ineffassign
    - staticcheck
    - typecheck
    - unused
    - revive

linters-settings:
  staticcheck:
    checks:
      - all
  custom:
    connecterr:
      path: connecterr.so
      description: xyz
    clouderr:
      path: clouderr.so
      description: xyz
    translatedstring:
      path: translatedstring.so
      description: xyz
  revive:
    rules:
      - name: var-naming
        disabled: true

Go version

1.23.5

Code example or link to a public repository

Not a public repo.

@andersroos
Copy link
Author

andersroos commented Feb 17, 2025

Forgot to mention, adding verify: false to the action config is a viable workaround.

@kurtislamb
Copy link

Fixed our issues, looks like there were some changes in the configuration file that needed looking at https://golangci-lint.run/usage/linters

@kurtislamb
Copy link

kurtislamb commented Feb 17, 2025

Might be worth posting your .golangci.yaml / validating against the latest docs

@andersroos
Copy link
Author

andersroos commented Feb 17, 2025

I did post it, it is under "Golangci-lint configuration" above. Can't see anything wrong with it related to the docs, the fields the validator complains about looks correct to me.

@ccoVeille
Copy link

ccoVeille commented Feb 17, 2025

Can't see anything wrong with it related to the docs, the fields the validator complains about looks correct to me.

I think the root cause might addressed here by @Namnamseo

So for now verify: false is an option

@ldez ldez self-assigned this Feb 17, 2025
@ldez ldez added the bug Something isn't working label Feb 17, 2025
@ldez
Copy link
Member

ldez commented Feb 17, 2025

The jsonschemas have been updated.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: verify bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants