Skip to content

chore: use revive linter#5712

Closed
faddat wants to merge 11 commits intocaddyserver:masterfrom
faddat:revive
Closed

chore: use revive linter#5712
faddat wants to merge 11 commits intocaddyserver:masterfrom
faddat:revive

Conversation

@faddat
Copy link
Copy Markdown
Contributor

@faddat faddat commented Aug 6, 2023

This PR enables the revive linter, and should be merged after gci and gofumpt, since it contains them.

  • use gofmput to format code
  • use gci to format imports
  • reconfigure gci
  • linter autofixes
  • rearrange imports a little
  • all changes other than unused-parameter
  • use revive linter

Contains

@faddat faddat mentioned this pull request Aug 6, 2023
Comment thread modules/caddyhttp/ip_range.go Outdated
Comment thread cmd/commandfuncs.go
return nil, fmt.Errorf("making request: %v", err)
}
if parsedAddr.IsUnixNetwork() {
if parsedAddr.IsUnixNetwork() { //nolint:revive
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What happens otherwise?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the revive linter prompts us to remove the empty code block that is currently just comments.

Comment thread modules/caddyhttp/push/handler.go
Comment on lines 772 to +773
var best []*Upstream
var bestReqs int = -1
bestReqs := -1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick but this is actually less symmetrical so it looks less nice. But whatever, it's fine.

Comment thread modules/caddyhttp/fileserver/matcher.go Outdated
Comment thread modules/logging/nopencoder.go Outdated
@faddat faddat mentioned this pull request Aug 6, 2023
@francislavoie
Copy link
Copy Markdown
Member

I'll review again after the parent PRs are merged, hard to follow the diffs until then.

@francislavoie francislavoie changed the title use revive linter chore: use revive linter Aug 14, 2023
@faddat faddat marked this pull request as draft August 14, 2023 05:36
@faddat
Copy link
Copy Markdown
Contributor Author

faddat commented Aug 14, 2023

Sorry, this one should be on draft for a minute. I may have revive configured a little too spicy.

@francislavoie -- perfect <3

@faddat
Copy link
Copy Markdown
Contributor Author

faddat commented Aug 14, 2023

I think this PR is no longer needed.

Prefer #5709

@faddat faddat closed this Aug 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.

3 participants