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

Linter PR 3: enable additional linters #589

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

faddat
Copy link
Contributor

@faddat faddat commented Dec 22, 2024

This pull request adds additional linters and works towards a more ideal configuration for the linter.

This is the most completely linted version. Before reviewing this, I do recommend that you review The pull requests that are in the style requested by @webmaster128

He asked for multiple PRS, each enabling more linters. This is the last of them.

@faddat faddat marked this pull request as draft December 22, 2024 19:26
@faddat faddat mentioned this pull request Dec 23, 2024
@faddat faddat marked this pull request as ready for review January 2, 2025 18:52
@faddat
Copy link
Contributor Author

faddat commented Jan 2, 2025

@webmaster128 please check this out, as well as the other, related pull requests.

@faddat faddat mentioned this pull request Jan 12, 2025
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

Not a full review.
I am interested in the linters (and the fixes that make them happy), but there are lots of unrelated changes in here that need to be discussed. I would appreciate if we keep these in separate PRs, so they don't block the us from merging the linters.

Comment on lines -334 to +337
if err != nil && err.(syscall.Errno) != C.ErrnoValue_Success {
if err != nil && err.(syscall.Errno) != 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change? I like the constant here because it makes it clear immediately that this is the unsuccessful case.

Copy link
Contributor Author

@faddat faddat Jan 17, 2025

Choose a reason for hiding this comment

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

can it ever return anything other than the constant?

The purpose of the change is to ensure that it catches all errors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

How does this change "ensure that it catches all errors"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

!= 0

@@ -1,6 +1,6 @@
module github.com/CosmWasm/wasmvm/v2

go 1.21
go 1.23
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this required for the linters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for copyloopvar, and best practices

internal/api/lib_test.go Outdated Show resolved Hide resolved
internal/api/memory.go Show resolved Hide resolved
internal/api/memory.go Show resolved Hide resolved
@faddat
Copy link
Contributor Author

faddat commented Jan 17, 2025

Hey, I hope I was sufficiently clear, I was writing from mobile before.

@webmaster128 asked for smaller PRs. This is the largest of them.

You'd want to review:

Before this one -- as for your review comments, thanks!

I will resolve issues with this PR shortly, but will remind that I was explicitly asked to make smaller PRs after a PR had sat for about 2 years.

And to be real, if the linters were interesting, I think it would not have sat for two years.

@faddat faddat changed the title enable additional linters Linter PR 3: enable additional linters Jan 17, 2025
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.

2 participants