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: Update golangci-lint to v1.55.2 #2817

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

nickajacks1
Copy link
Member

Description

Update golangci-lint to the latest version.
New linters and failing rules were commented out for visibility and tagged with TODO comments.

Related to #2816

Type of Change

Please delete options that are not relevant.

  • Code consistency (non-breaking change which improves code reliability and robustness)

Checklist

Before you submit your pull request, please make sure you meet these requirements:

  • Conducted a self-review of the code and provided comments for complex or critical parts.
  • Verified that any new dependencies are essential and have been agreed upon by the maintainers/community.

@nickajacks1
Copy link
Member Author

In addition to the new linters mentioned in #2816, several rules and existing linters had a large number of new issues, so I just disabled them for now.

Disabled rules and linters:

  • gosec: G104 is now raised for _ assignments (at least when audit: true is set). Exclude G104 until unchecked errors are ignored (there are a lot).
  • depguard: the config format has changed
  • revive
    • comment-spacings: spaces after the // in a comment - there are a few instances of this, including "decorated" comments
    • exported,disableStutterCheck: some functions, eg csrf.CsrfFromHeader are advised to be changed to csrf.FromHeader. Updating these would be breaking changes, so they should be fixed before v3 is released, and they should be noted in any migration guides.
    • unchecked-type-assertion: overlaps with errcheck
  • goconst: this seems to be more strict now. A few of the new rules might be a little awkward to fix. we'll see.
  • wastedassign: this seems to be more strict now.

Maybe we can drop errcheck in favor of revive's unchecked-type-assertion and gosec's G104? Or the other way around?

@ReneWerner87 ReneWerner87 linked an issue Jan 28, 2024 that may be closed by this pull request
3 tasks
@ReneWerner87
Copy link
Member

Maybe we can drop errcheck in favor of revive's unchecked-type-assertion and gosec's G104? Or the other way around?

as long as a check is on, that would be okay, the important thing is that the error returns are always checked

@nickajacks1 nickajacks1 marked this pull request as ready for review January 28, 2024 18:11
.golangci.yml Show resolved Hide resolved
Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

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

LGTM

@ReneWerner87 ReneWerner87 merged commit ccf1611 into gofiber:main Jan 30, 2024
12 checks passed
@nickajacks1 nickajacks1 deleted the golangci-update branch January 31, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🧹 [Maintenance]: Update golangci-lint
3 participants