tyk icon indicating copy to clipboard operation
tyk copied to clipboard

`golangci-lint` GitHub Action does not actually perform linting of the source code.

Open craicoverflow opened this issue 3 years ago • 5 comments

Do you want to request a feature or report a bug?

I guess it is a bug, but a bug in CI, not code.

What is the current behavior?

The golangci-lint runs only in the project root where there is no *.go files so in reality the project is not being linted.

What is the expected behavior?

The golangci-lint GitHub Action should lint the Go code.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

N/A

Which versions of Tyk affected by this issue? Did this work in previous versions of Tyk?

N/A

craicoverflow avatar Jun 27 '21 08:06 craicoverflow

P.S: I've prepared a fix for this if you'd like me to PR it.

craicoverflow avatar Jun 27 '21 19:06 craicoverflow

Hey @craicoverflow we'll take a PR for sure! Adding @buger for visibility.

christtyk avatar Jun 28 '21 08:06 christtyk

Sure thing @christtyk!

It should work by editing the args value like so:

- args: --timeout=5m --verbose
+ args: ./... --timeout=5m --verbose

In https://github.com/TykTechnologies/tyk/blob/master/.github/workflows/golangci-lint.yml#L29

craicoverflow avatar Jun 28 '21 13:06 craicoverflow

This has probablly been changed, I do see the golangci-lint report issues without changes to ./... (see here). I also verified with nektos/act that the invocation particularly includes ./..., if defined in the action .yml config:

[golangci-lint/lint]   ❓  ::group::run golangci-lint
| Running [/root/golangci-lint-1.44.2-linux-amd64/golangci-lint run --out-format=github-actions ./... --timeout=5m --verbose] in [] ...

There is no difference in runs if ./... is added to the config. If there are no objections, I suggest closing this issue.

titpetric avatar Mar 04 '22 09:03 titpetric

@craicoverflow perhaps only-new-issues: true is the underlying cause.

titpetric avatar Mar 04 '22 10:03 titpetric

I will close this ticket, given the time that has passed since @titpetric's feedback.

If you still have an issue, please do not hesitate to re-open the ticket.

Thanks for supporting Tyk!

andyo-tyk avatar Mar 21 '23 14:03 andyo-tyk