-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
ci: Run golangci-lint on multiple os(#4875) #4913
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Just one question, otherwise LGTM.
.github/workflows/lint.yml
Outdated
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add windows-latest
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should, yes.
We could also bump up the golangci-lint version to v1.47 https://github.com/golangci/golangci-lint/releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@francislavoie @mholt
Hi, I'm trying to be upped the golangci-lint version, Although, I found the lint error(It has not occurred in the old version)
I consider that it should treat another issue once.
https://pkg.go.dev/github.com/google/cel-go/cel#Ast.ResultType
https://pkg.go.dev/github.com/google/cel-go/cel#Functions
run golangci-lint
Running [/home/runner/golangci-lint-1.47.2-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
Error: SA1019: checked.ResultType is deprecated: use OutputType (staticcheck)
Error: SA1019: checked.ResultType is deprecated: use OutputType (staticcheck)
Error: SA1019: cel.Functions is deprecated: use Function() instead to declare the function, its overload signatures, and the overload implementations. (staticcheck)
Error: SA1019: cel.Functions is deprecated: use Function() instead to declare the function, its overload signatures, and the overload implementations. (staticcheck)
Error: SA1019: cel.Functions is deprecated: use Function() instead to declare the function, its overload signatures, and the overload implementations. (staticcheck)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solving that requires uncommenting the line:
# only-new-issues: true
I vote for uncommenting the line, otherwise the lint errors might confuse the PRs with multiple unrelated changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am actually working on a fix for those errors as I type this.
I got it to compile but now the tests fail related to those Function()
changes... I'm not sure how to use it properly.
7c9e1f3
to
e804caa
Compare
Is there also a reason this updated go.mod? I believe the only change should be on the yml file right? |
dff4356
to
4a68153
Compare
@mholt |
@u5surf Any idea why the linter is complaining of It only happens on Windows, and running |
I bet it's the line-endings. There are instructions on the action repo to add |
The line endings look fine to me, LF on all the files... 🤔 |
@mholt We should add the .gitattribute file to avoid the line-endings problem like this. |
We can do that. Thanks. Any idea why it only affects those 3 files, even though they already use LF? |
Could you tell me what 3 files' names are? I could not find those from the result of CI which you refer to. |
@u5surf They were metrics and notify files: https://github.com/caddyserver/caddy/actions/runs/2756929369 Ah, no worries, I also don't dev on Windows. Just thought I'd ask if you knew since none of us can figure it out, haha. |
#4875
https://github.com/golangci/golangci-lint-action#multiple-os-support