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

Ensures golangci-lint is latest release version in CI #12018

Merged
merged 12 commits into from
Jul 14, 2023

Conversation

markylaing
Copy link
Contributor

The PR ensures golangci-lint is the latest version when running in CI. If lint errors occur in CI that a developer did not encounter locally, they can check against the latest version with rm $GOPATH/bin/golangci-lint && make static-analysis.

It looks like the gci linter has changed a little and is unhappy with any files containing GCO. It is possible to reorder the imports to make this pass but I found the change less clear so I have excluded any files containing CGO from gci linting (other linters will still run).

Partially addresses #12011

@tomponline
Copy link
Member

It looks like the gci linter has changed a little and is unhappy with any files containing GCO. It is possible to reorder the imports to make this pass but I found the change less clear so I have excluded any files containing CGO from gci linting (other linters will still run).

Can you give us an example of the suggested changes? As excluding the gci linter from CGO files means we can presumably make non-cgo related import ordering changes that would otherwise be flagged by the linter in those files? That doesn't sound good to me if i am interpreting that correctly.

.golangci.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@monstermunchkin monstermunchkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't exclude cgo files for the gci linter, but move the C code to the top.

Makefile Outdated Show resolved Hide resolved
@markylaing
Copy link
Contributor Author

It looks like the gci linter has changed a little and is unhappy with any files containing GCO. It is possible to reorder the imports to make this pass but I found the change less clear so I have excluded any files containing CGO from gci linting (other linters will still run).

Can you give us an example of the suggested changes? As excluding the gci linter from CGO files means we can presumably make non-cgo related import ordering changes that would otherwise be flagged by the linter in those files? That doesn't sound good to me if i am interpreting that correctly.

I was just mistaken about this. Yes we can just move the C to the top of the files as @monstermunchkin suggests.

@tomponline
Copy link
Member

It looks like the gci linter has changed a little and is unhappy with any files containing GCO. It is possible to reorder the imports to make this pass but I found the change less clear so I have excluded any files containing CGO from gci linting (other linters will still run).

Can you give us an example of the suggested changes? As excluding the gci linter from CGO files means we can presumably make non-cgo related import ordering changes that would otherwise be flagged by the linter in those files? That doesn't sound good to me if i am interpreting that correctly.

I was just mistaken about this. Yes we can just move the C to the top of the files as @monstermunchkin suggests.

Thanks @monstermunchkin @markylaing that sounds good.

@tomponline
Copy link
Member

Thanks!

@tomponline tomponline merged commit dfea832 into canonical:main Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants