Linting improvements.

This commit is contained in:
Stanislav Nikitin 2020-12-24 13:48:00 +05:00
parent 9410522dd5
commit f1418a7a31
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550
3 changed files with 11 additions and 7 deletions

View File

@ -3,17 +3,10 @@ run:
linters: linters:
enable-all: true enable-all: true
disable: disable:
# Because globals might exist, but according to our codestyle they
# should be lowercased and considered as unexported.
- gochecknoglobals
# While it might be useful it'll create more problems that will solve. # While it might be useful it'll create more problems that will solve.
- gocritic - gocritic
# Complains about main() lengths, which isn't an issue.
- funlen
# Magic numbers might be everywhere. Disabled for now. # Magic numbers might be everywhere. Disabled for now.
- gomnd - gomnd
# ToDos everywhere
- godox
# Why? WHY? WHY _test??? # Why? WHY? WHY _test???
- testpackage - testpackage
linters-settings: linters-settings:
@ -23,3 +16,12 @@ linters-settings:
min-complexity: 40 min-complexity: 40
gocognit: gocognit:
min-complexity: 40 min-complexity: 40
funlen:
lines: 200
issues:
exclude-rules:
# There will be some ToDos.
- linters:
- godox
text: "TODO"

View File

@ -1,5 +1,6 @@
package common package common
// nolint:gochecknoglobals
var ( var (
Branch string Branch string
Build string Build string

View File

@ -13,6 +13,7 @@ import (
"go.dev.pztrn.name/metricator/internal/models" "go.dev.pztrn.name/metricator/internal/models"
) )
// nolint:gochecknoglobals
var ( var (
errInvalidAPIVersion = errors.New("invalid API version") errInvalidAPIVersion = errors.New("invalid API version")
errInvalidApplication = errors.New("invalid application") errInvalidApplication = errors.New("invalid application")