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

build: update linter #489

Closed
wants to merge 1 commit into from
Closed

build: update linter #489

wants to merge 1 commit into from

Conversation

dajohi
Copy link
Member

@dajohi dajohi commented Sep 19, 2024

No description provided.

@@ -1,6 +1,6 @@
module github.com/decred/vspd/client/v4

go 1.19
Copy link
Member

Choose a reason for hiding this comment

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

Why is this bumped? Nothing requires it.

@@ -1,6 +1,6 @@
module github.com/decred/vspd

go 1.20
Copy link
Member

Choose a reason for hiding this comment

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

Same. No reason to bump this.

Copy link
Member Author

Choose a reason for hiding this comment

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

copyloopvar requires it.

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't seem very prudent to me to require a new version of Go for all consumers just to add a linter.

Copy link
Member

Choose a reason for hiding this comment

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

Agree with @davecgh here, leave the go.mod files as they are and the linter will just output a warning rather than causing a build failure:

==> lint types
WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.19) of your project is lower than Go 1.22

We can live with the warning for now and I will add this as a note to #488

- fatcontext
- goconst
- godot
- gofmt
- goimports
- gosimple
- govet
- grouper
Copy link
Member

Choose a reason for hiding this comment

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

The default config for grouper has all functionality disabled, which means just adding it to this list does nothing.

Besides that, I don't agree with the premise of this linter. Why should it be forced that only singles or groups of declarations can be used? In some cases a single makes sense (example), and in other cases its helpful to group related values together (example).

@@ -32,6 +33,8 @@ linters:
- predeclared
- reassign
- revive
- rowserrcheck
Copy link
Member

Choose a reason for hiding this comment

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

This project doesn't use SQL so these two linters are unnecessary.

@@ -1,6 +1,6 @@
module github.com/decred/vspd

go 1.20
Copy link
Member

Choose a reason for hiding this comment

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

Agree with @davecgh here, leave the go.mod files as they are and the linter will just output a warning rather than causing a build failure:

==> lint types
WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.19) of your project is lower than Go 1.22

We can live with the warning for now and I will add this as a note to #488

@jholdstock
Copy link
Member

Merged into #488 and #490

@jholdstock jholdstock closed this Oct 16, 2024
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.

3 participants