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

golangci party #364

Merged
merged 6 commits into from
Jan 21, 2025
Merged

golangci party #364

merged 6 commits into from
Jan 21, 2025

Conversation

ccoVeille
Copy link
Collaborator

@ccoVeille ccoVeille commented Jan 20, 2025

  • chore: fix a lot of godoc
  • chore: avoid redefining min/max
  • chore: avoid unused parameter
  • chore: use common receiver names
  • chore: enable most of the default revive rules
  • chore: enable most gocritic rules

Motivation: I noticed some errors in the godoc, then I checked with revive and wow, so many things to fix

and add a linter to catch them
And add a linter for avoiding such issues.
The linter is still disabled as they are more errors to fix.
But it would require further checks and discussion, this is a good start
Also enable a linter to detect such issues
Apply the reported changes to the codebase.

Disable some rules that might be reporting false positives.
But it could also be bugs, so it requires manual review and discussion.
@EwenQuim EwenQuim added this to the v0.18 milestone Jan 21, 2025
Comment on lines 44 to 51
func (m DataOrTemplate[T]) Render(c context.Context, w io.Writer) error {
switch m.Template.(type) {
switch renderer := m.Template.(type) {
case CtxRenderer:
return m.Template.(CtxRenderer).Render(c, w)
return renderer.Render(c, w)
case Renderer:
return m.Template.(Renderer).Render(w)
return renderer.Render(w)
default:
panic("template must be either CtxRenderer or Renderer")
Copy link
Member

Choose a reason for hiding this comment

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

OMG I didn't know that, that's nice :)

Copy link
Member

@EwenQuim EwenQuim left a comment

Choose a reason for hiding this comment

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

A load of nice little improvements, thanks!

@EwenQuim EwenQuim merged commit 6b360d2 into main Jan 21, 2025
6 of 7 checks passed
@EwenQuim EwenQuim deleted the golangci-party branch January 21, 2025 13:41
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