Skip to content

Commit

Permalink
ci: upgrade the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Aug 4, 2022
1 parent 6a1e610 commit 2c55fbf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
go generate ./...
- uses: golangci/golangci-lint-action@v3
with:
version: v1.47
version: v1.48
skip-pkg-cache: true
skip-build-cache: true
11 changes: 6 additions & 5 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ issues:
linters:
enable-all: true
disable:
- exhaustivestruct # deprecated
- golint # deprecated
- exhaustivestruct # deprecated; replaced by exhaustruct
- golint # deprecated; replaced by revive
- ifshort # deprecated
- interfacer # deprecated
- ireturn # ireturn works poorly for the style with private types and public interfaces
- maligned # deprecated, and I value readability over bytes saved by alignment
- scopelint # deprecated
- nlreturn # I don't agree with the style enforced by nlreturn
- nonamedreturns # named returns are needed in the internal updator package
- nosnakecase # revive's var-naming check seems to be better
- scopelint # deprecated; replaced by exportloopref
- varnamelen # varnamelen complains too much, in my opinion
- wsl # I don't agree with the style enforced by wsl
- nosnakecase # revive's var-naming check seems to be better
- nonamedreturns # named returns are needed in the internal updator package
5 changes: 3 additions & 2 deletions internal/api/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"golang.org/x/net/idna"
)

//nolint:gochecknoglobals
// profile does C2 in UTS#46 with all checks on + removing leading dots.
// profileDroppingLeadingDots does C2 in UTS#46 with all checks on + removing leading dots.
// This is the main conversion profile in use.
//
//nolint:gochecknoglobals
var (
profileDroppingLeadingDots = idna.New(
idna.MapForLookup(),
Expand Down
1 change: 1 addition & 0 deletions internal/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func ReadDomains(ppfmt pp.PP, key string, field *[]api.Domain) bool {
// ReadProvider reads an environment variable and parses it as a provider.
//
// policyKey was the name of the deprecated parameters IP4/6_POLICY.
//
//nolint:funlen, cyclop
func ReadProvider(ppfmt pp.PP, key, keyDeprecated string, field *provider.Provider) bool {
if val := Getenv(key); val == "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/monitor/healthchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewHealthChecks(ppfmt pp.PP, rawURL string, os ...HealthChecksOption) (Moni
return nil, false
}

if !(url.IsAbs() && url.Opaque == "" && url.Host != "") { //nolint:lll
if !(url.IsAbs() && url.Opaque == "" && url.Host != "") {
ppfmt.Errorf(pp.EmojiUserError, `The Healthchecks.io URL (redacted) does not look like a valid URL.`)
ppfmt.Errorf(pp.EmojiUserError, `A valid example is "https://hc-ping.com/01234567-0123-0123-0123-0123456789abc".`)
return nil, false
Expand Down

0 comments on commit 2c55fbf

Please sign in to comment.