Skip to content
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

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

u5surf
Copy link
Contributor

@u5surf u5surf commented Jul 26, 2022

mholt
mholt previously requested changes Jul 26, 2022
Copy link
Member

@mholt mholt left a 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.

runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Copy link
Member

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?

Copy link
Member

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

Copy link
Contributor Author

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)

Copy link
Member

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.

Copy link
Member

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.

@u5surf u5surf force-pushed the issue-4875 branch 2 times, most recently from 7c9e1f3 to e804caa Compare July 27, 2022 01:04
@francislavoie francislavoie added the CI/CD 🔩 Automated tests, releases label Jul 27, 2022
@francislavoie francislavoie added this to the v2.5.3 milestone Jul 27, 2022
@mholt
Copy link
Member

mholt commented Jul 27, 2022

Is there also a reason this updated go.mod? I believe the only change should be on the yml file right?

@u5surf u5surf force-pushed the issue-4875 branch 2 times, most recently from dff4356 to 4a68153 Compare July 27, 2022 03:38
@u5surf
Copy link
Contributor Author

u5surf commented Jul 27, 2022

Is there also a reason this updated go.mod? I believe the only change should be on the yml file right?

@mholt
Sorry, my bad, I mistake rebasing, I fixed it to be only my commit.

@francislavoie francislavoie merged commit c833e3b into caddyserver:master Jul 27, 2022
@mholt
Copy link
Member

mholt commented Jul 28, 2022

@u5surf Any idea why the linter is complaining of gofmt on these files here which have already been gofmt'ed? https://github.com/caddyserver/caddy/actions/runs/2756929369

It only happens on Windows, and running gofmt -s -w yields no changes.

@mohammed90
Copy link
Member

@u5surf Any idea why the linter is complaining of gofmt on these files here which have already been gofmt'ed? https://github.com/caddyserver/caddy/actions/runs/2756929369

It only happens on Windows, and running gofmt -s -w yields no changes.

I bet it's the line-endings. There are instructions on the action repo to add .gitattributes file for that.

@francislavoie
Copy link
Member

The line endings look fine to me, LF on all the files... 🤔

@u5surf
Copy link
Contributor Author

u5surf commented Jul 28, 2022

@mholt We should add the .gitattribute file to avoid the line-endings problem like this.
https://github.com/microsoft/vscode-dev-containers/blob/main/.gitattributes
......I thought but I guess it had already been fixed by @mohammed90 😄
#4919

@mholt
Copy link
Member

mholt commented Jul 29, 2022

We can do that. Thanks. Any idea why it only affects those 3 files, even though they already use LF?

@u5surf
Copy link
Contributor Author

u5surf commented Jul 29, 2022

@mholt

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.
Just so there's no misunderstanding, I can't execute the golangci-lint on Windows because I don't have any Windows environments. OTOH, I can only investigate the detail of those files or what is different from anything else.

@mholt
Copy link
Member

mholt commented Jul 29, 2022

@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.

@mholt mholt modified the milestones: v2.6.0-beta.1, v2.6.0 Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD 🔩 Automated tests, releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants