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:
enable-all: true
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.
- gocritic
# Complains about main() lengths, which isn't an issue.
- funlen
# Magic numbers might be everywhere. Disabled for now.
- gomnd
# ToDos everywhere
- godox
# Why? WHY? WHY _test???
- testpackage
linters-settings:
@ -23,3 +16,12 @@ linters-settings:
min-complexity: 40
gocognit:
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
// nolint:gochecknoglobals
var (
Branch string
Build string

View File

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