mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 12:17:24 +00:00
fix ci lint warnings
This commit is contained in:
parent
a67aa05646
commit
acdd9f4195
@ -83,9 +83,6 @@ linters:
|
|||||||
# checks function and package cyclomatic complexity [fast: false, auto-fix: false]
|
# checks function and package cyclomatic complexity [fast: false, auto-fix: false]
|
||||||
# not use because gocognit is used
|
# not use because gocognit is used
|
||||||
- cyclop
|
- cyclop
|
||||||
# The owner seems to have abandoned the linter. Replaced by unused.
|
|
||||||
# deprecated, replaced by unused
|
|
||||||
- deadcode
|
|
||||||
# check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false]
|
# check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false]
|
||||||
# FUTURE: IMO it sometimes makes sense to declare consts or types after a func
|
# FUTURE: IMO it sometimes makes sense to declare consts or types after a func
|
||||||
- decorder
|
- decorder
|
||||||
@ -107,18 +104,9 @@ linters:
|
|||||||
# Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted. [fast: false, auto-fix: false]
|
# Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted. [fast: false, auto-fix: false]
|
||||||
# FUTURE: use asap, because we use json alot. nice feature is possiblity to check if err check is required
|
# FUTURE: use asap, because we use json alot. nice feature is possiblity to check if err check is required
|
||||||
- errchkjson
|
- errchkjson
|
||||||
# execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds
|
|
||||||
# FUTURE: might find some errors in sql queries
|
|
||||||
- execinquery
|
|
||||||
# Checks if all struct's fields are initialized [fast: false, auto-fix: false]
|
|
||||||
# deprecated
|
|
||||||
- exhaustivestruct
|
|
||||||
# Checks if all structure fields are initialized
|
# Checks if all structure fields are initialized
|
||||||
# Not all fields have to be initialized
|
# Not all fields have to be initialized
|
||||||
- exhaustruct
|
- exhaustruct
|
||||||
# checks for pointers to enclosing loop variables [fast: false, auto-fix: false]
|
|
||||||
# FUTURE: finds bugs hard to find, could occur much later
|
|
||||||
- exportloopref
|
|
||||||
# Forbids identifiers [fast: true, auto-fix: false]
|
# Forbids identifiers [fast: true, auto-fix: false]
|
||||||
# see no reason. allows to define regexp which are not allowed to use
|
# see no reason. allows to define regexp which are not allowed to use
|
||||||
- forbidigo
|
- forbidigo
|
||||||
@ -148,7 +136,7 @@ linters:
|
|||||||
- godox
|
- godox
|
||||||
# Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
|
# Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
|
||||||
# Not used in favore of errorlint
|
# Not used in favore of errorlint
|
||||||
- goerr113
|
- err113
|
||||||
# Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
|
# Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
|
||||||
# ignored in favor of goimports
|
# ignored in favor of goimports
|
||||||
- gofmt
|
- gofmt
|
||||||
@ -161,12 +149,6 @@ linters:
|
|||||||
# In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true]
|
# In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true]
|
||||||
# ignored in favor of gci
|
# ignored in favor of gci
|
||||||
- goimports
|
- goimports
|
||||||
#deprecated]: Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: false, auto-fix: false]
|
|
||||||
# ignored in favor of goimports
|
|
||||||
- golint
|
|
||||||
# An analyzer to detect magic numbers. [fast: true, auto-fix: false]
|
|
||||||
# FUTURE: not that critical at the moment
|
|
||||||
- gomnd
|
|
||||||
# Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false]
|
# Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false]
|
||||||
# FUTURE: not a problem at the moment
|
# FUTURE: not a problem at the moment
|
||||||
- gomoddirectives
|
- gomoddirectives
|
||||||
@ -182,18 +164,12 @@ linters:
|
|||||||
# An analyzer to analyze expression groups. [fast: true, auto-fix: false]
|
# An analyzer to analyze expression groups. [fast: true, auto-fix: false]
|
||||||
# I think the groups (vars, consts, imports, ...) we have atm are ok
|
# I think the groups (vars, consts, imports, ...) we have atm are ok
|
||||||
- grouper
|
- grouper
|
||||||
# Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false]
|
|
||||||
# Dont't use its deprecated
|
|
||||||
- ifshort
|
|
||||||
# Enforces consistent import aliases [fast: false, auto-fix: false]
|
# Enforces consistent import aliases [fast: false, auto-fix: false]
|
||||||
# FUTURE: aliasing of imports is more or less consistent
|
# FUTURE: aliasing of imports is more or less consistent
|
||||||
- importas
|
- importas
|
||||||
# A linter that checks the number of methods inside an interface.
|
# A linter that checks the number of methods inside an interface.
|
||||||
# No need at the moment, repository abstraction was removed
|
# No need at the moment, repository abstraction was removed
|
||||||
- interfacebloat
|
- interfacebloat
|
||||||
# A linter that suggests interface types
|
|
||||||
# Don't use it's archived
|
|
||||||
- interfacer
|
|
||||||
# Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false]
|
# Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false]
|
||||||
# FUTURE: check if no interface is returned
|
# FUTURE: check if no interface is returned
|
||||||
- ireturn
|
- ireturn
|
||||||
@ -227,9 +203,6 @@ linters:
|
|||||||
# Reports all names returns
|
# Reports all names returns
|
||||||
# Named returns are not allowed which IMO reduces readability of code
|
# Named returns are not allowed which IMO reduces readability of code
|
||||||
- nonamedreturns
|
- nonamedreturns
|
||||||
# detects snake case of variable naming and function name.
|
|
||||||
# has not been a problem in our code and deprecated
|
|
||||||
- nosnakecase
|
|
||||||
# paralleltest detects missing usage of t.Parallel() method in your Go test [fast: true, auto-fix: false]
|
# paralleltest detects missing usage of t.Parallel() method in your Go test [fast: true, auto-fix: false]
|
||||||
# FUTURE: will break all of our tests
|
# FUTURE: will break all of our tests
|
||||||
- paralleltest
|
- paralleltest
|
||||||
@ -248,12 +221,6 @@ linters:
|
|||||||
# Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
|
# Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
|
||||||
# Linter aggregator, would allow to use less other linters
|
# Linter aggregator, would allow to use less other linters
|
||||||
- revive
|
- revive
|
||||||
# checks for unpinned variables in go programs
|
|
||||||
# deprecated
|
|
||||||
- scopelint
|
|
||||||
# Finds unused struct fields [fast: false, auto-fix: false]
|
|
||||||
# deprecated, replaced by unused
|
|
||||||
- structcheck
|
|
||||||
# Stylecheck is a replacement for golint [fast: false, auto-fix: false]
|
# Stylecheck is a replacement for golint [fast: false, auto-fix: false]
|
||||||
# we use goimports
|
# we use goimports
|
||||||
- stylecheck
|
- stylecheck
|
||||||
@ -281,9 +248,6 @@ linters:
|
|||||||
# A linter that detect the possibility to use variables/constants from the Go standard library.
|
# A linter that detect the possibility to use variables/constants from the Go standard library.
|
||||||
# FUTURE: improves code quality
|
# FUTURE: improves code quality
|
||||||
- usestdlibvars
|
- usestdlibvars
|
||||||
# Finds unused global variables and constants [fast: false, auto-fix: false]
|
|
||||||
# deprecated, replaced by unused
|
|
||||||
- varcheck
|
|
||||||
# checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
|
# checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
|
||||||
# I would not use it because it more or less checks if var lenght matches
|
# I would not use it because it more or less checks if var lenght matches
|
||||||
- varnamelen
|
- varnamelen
|
||||||
|
2
Makefile
2
Makefile
@ -140,5 +140,5 @@ core_lint:
|
|||||||
golangci-lint run \
|
golangci-lint run \
|
||||||
--timeout 10m \
|
--timeout 10m \
|
||||||
--config ./.golangci.yaml \
|
--config ./.golangci.yaml \
|
||||||
--out-format=github-actions \
|
--out-format=colored-line-number \
|
||||||
--concurrency=$$(getconf _NPROCESSORS_ONLN)
|
--concurrency=$$(getconf _NPROCESSORS_ONLN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user