chore: update linter

This commit is contained in:
Fernandez Ludovic 2023-05-05 09:51:42 +02:00
parent aeec5be129
commit 67d80a1445
4 changed files with 33 additions and 4 deletions

View file

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
GO_VERSION: '1.20' GO_VERSION: '1.20'
GOLANGCI_LINT_VERSION: v1.51.2 GOLANGCI_LINT_VERSION: v1.52.2
HUGO_VERSION: 0.54.0 HUGO_VERSION: 0.54.0
CGO_ENABLED: 0 CGO_ENABLED: 0
LEGO_E2E_TESTS: CI LEGO_E2E_TESTS: CI

View file

@ -46,6 +46,36 @@ linters-settings:
- ruleguard - ruleguard
- httpNoBody - httpNoBody
- exposedSyncMutex - exposedSyncMutex
revive:
rules:
- name: struct-tag
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: true
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
disabled: true
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unused-parameter
disabled: true
- name: unreachable-code
- name: redefines-builtin-id
linters: linters:
enable-all: true enable-all: true
@ -103,7 +133,6 @@ issues:
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked' - 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
- 'exported (type|method|function) (.+) should have comment or be unexported' - 'exported (type|method|function) (.+) should have comment or be unexported'
- 'ST1000: at least one file in a package should have a package comment' - 'ST1000: at least one file in a package should have a package comment'
- 'package-comments: should have a package comment'
exclude-rules: exclude-rules:
- path: (.+)_test.go - path: (.+)_test.go
linters: linters:

View file

@ -19,7 +19,7 @@ func (e obtainError) Error() string {
sort.Strings(domains) sort.Strings(domains)
for _, domain := range domains { for _, domain := range domains {
buffer.WriteString(fmt.Sprintf("[%s] %s\n", domain, e[domain])) _, _ = fmt.Fprintf(buffer, "[%s] %s\n", domain, e[domain])
} }
return buffer.String() return buffer.String()
} }

View file

@ -19,7 +19,7 @@ func (e obtainError) Error() string {
sort.Strings(domains) sort.Strings(domains)
for _, domain := range domains { for _, domain := range domains {
buffer.WriteString(fmt.Sprintf("[%s] %s\n", domain, e[domain])) _, _ = fmt.Fprintf(buffer, "[%s] %s\n", domain, e[domain])
} }
return buffer.String() return buffer.String()
} }