From c0f04e87e748baa83baebc3a20698604e4186568 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 12 Jun 2024 03:09:21 +0200 Subject: [PATCH] chore: update linter (#2206) --- .github/workflows/pr.yml | 2 +- .golangci.yml | 1 + docs/data/zz_cli_help.toml | 8 ++++---- go.sum | 5 +---- providers/dns/dynu/internal/client_test.go | 2 +- providers/dns/rcodezero/internal/client_test.go | 2 +- providers/dns/servercow/internal/client_test.go | 4 ++-- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 038ed624..d75b8a3d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest env: GO_VERSION: stable - GOLANGCI_LINT_VERSION: v1.59.0 + GOLANGCI_LINT_VERSION: v1.59.1 HUGO_VERSION: 0.117.0 CGO_ENABLED: 0 LEGO_E2E_TESTS: CI diff --git a/.golangci.yml b/.golangci.yml index d62ad647..74b0e4af 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -137,6 +137,7 @@ linters: - gosmopolitan # not relevant - exportloopref # Useless with go1.22 - canonicalheader # Can create side effects in the context of API clients + - usestdlibvars # false-positive https://github.com/sashamelentyev/usestdlibvars/issues/96 issues: exclude-use-default: false diff --git a/docs/data/zz_cli_help.toml b/docs/data/zz_cli_help.toml index bb57a56b..b1b4072c 100644 --- a/docs/data/zz_cli_help.toml +++ b/docs/data/zz_cli_help.toml @@ -59,7 +59,7 @@ NAME: lego run - Register an account, then create and install a certificate USAGE: - lego run [command options] [arguments...] + lego run [command options] OPTIONS: --no-bundle Do not create a certificate bundle by adding the issuers certificate to the new certificate. (default: false) @@ -79,7 +79,7 @@ NAME: lego renew - Renew a certificate USAGE: - lego renew [command options] [arguments...] + lego renew [command options] OPTIONS: --days value The number of days left on a certificate to renew it. (default: 30) @@ -104,7 +104,7 @@ NAME: lego revoke - Revoke a certificate USAGE: - lego revoke [command options] [arguments...] + lego revoke [command options] OPTIONS: --keep, -k Keep the certificates after the revocation instead of archiving them. (default: false) @@ -119,7 +119,7 @@ NAME: lego list - Display certificates and accounts information. USAGE: - lego list [command options] [arguments...] + lego list [command options] OPTIONS: --accounts, -a Display accounts. (default: false) diff --git a/go.sum b/go.sum index 5df8d5ba..4dfcc814 100644 --- a/go.sum +++ b/go.sum @@ -751,8 +751,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -918,8 +917,6 @@ golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/providers/dns/dynu/internal/client_test.go b/providers/dns/dynu/internal/client_test.go index 6819310f..7f33bc2c 100644 --- a/providers/dns/dynu/internal/client_test.go +++ b/providers/dns/dynu/internal/client_test.go @@ -106,7 +106,7 @@ func TestGetRootDomain(t *testing.T) { require.NoError(t, err) - assert.NotNil(t, domain) //nolint:testifylint // false positive https://github.com/Antonboom/testifylint/issues/95 + assert.NotNil(t, domain) assert.Equal(t, test.expected.domain, domain) }) } diff --git a/providers/dns/rcodezero/internal/client_test.go b/providers/dns/rcodezero/internal/client_test.go index 09678608..c19e6e5b 100644 --- a/providers/dns/rcodezero/internal/client_test.go +++ b/providers/dns/rcodezero/internal/client_test.go @@ -74,7 +74,7 @@ func TestClient_UpdateRecords_error(t *testing.T) { resp, err := client.UpdateRecords(context.Background(), "example.org", rrSet) require.ErrorAs(t, err, new(*APIResponse)) - assert.Nil(t, resp) //nolint:testifylint // false positive https://github.com/Antonboom/testifylint/issues/95 + assert.Nil(t, resp) } func TestClient_UpdateRecords(t *testing.T) { diff --git a/providers/dns/servercow/internal/client_test.go b/providers/dns/servercow/internal/client_test.go index 48464928..8597d7e1 100644 --- a/providers/dns/servercow/internal/client_test.go +++ b/providers/dns/servercow/internal/client_test.go @@ -151,7 +151,7 @@ func TestClient_CreateUpdateRecord_error(t *testing.T) { msg, err := client.CreateUpdateRecord(context.Background(), "lego.wtf", record) require.Error(t, err) - assert.Nil(t, msg) //nolint:testifylint // false positive https://github.com/Antonboom/testifylint/issues/95 + assert.Nil(t, msg) } func TestClient_DeleteRecord(t *testing.T) { @@ -218,5 +218,5 @@ func TestClient_DeleteRecord_error(t *testing.T) { msg, err := client.DeleteRecord(context.Background(), "lego.wtf", record) require.Error(t, err) - assert.Nil(t, msg) //nolint:testifylint // false positive https://github.com/Antonboom/testifylint/issues/95 + assert.Nil(t, msg) }