Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
mschfh authored May 8, 2024
1 parent 6fd74c0 commit 3f0a846
Showing 1 changed file with 66 additions and 4 deletions.
70 changes: 66 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,76 @@
run:
go: "1.22"
timeout: 3m

linters-settings:
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 10
# The maximal average package complexity.
# If it's higher than 0.0 (float) the check is enabled
# Default: 0.0
package-average: 10.0

errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
check-type-assertions: true

gocritic:
# Settings passed to gocritic.
# The settings key is the name of a supported gocritic checker.
# The list of supported checkers can be find in https://go-critic.github.io/overview.
settings:
captLocal:
# Whether to restrict checker to params only.
# Default: true
paramsOnly: false
underef:
# Whether to skip (*x).method() calls where x is a pointer receiver.
# Default: true
skipRecvDeref: false

govet:
enable:
- shadow

varcheck:
# Check usage of exported fields and variables.
# Default: false
exported-fields: true

linters:
disable-all: true
enable:
- govet
- revive
## enabled by default
- unused # Finds unused code
- gofmt
- goimports
# - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
# - gosimple # Linter for Go source code that specializes in simplifying a code
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- ineffassign # Detects when assignments to existing variables are not used
# - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
# - structcheck # Finds unused struct fields
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
# - unused # Checks Go code for unused constants, variables, functions and types
# - varcheck # Finds unused global variables and constants
# ## disabled by default
# - contextcheck # check the function whether use a non-inherited context
# - cyclop # checks function and package cyclomatic complexity
# - errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
# - gocritic # Provides diagnostics that check for bugs, performance and style issues.
# - gocyclo # Computes and checks the cyclomatic complexity of functions
# - nestif # Reports deeply nested if statements
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
# - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed
# - stylecheck # Stylecheck is a replacement for golint
# - wastedassign # wastedassign finds wasted assignment statements.
# - whitespace # Tool for detection of leading and trailing whitespace


issues:
exclude-use-default: false
exclude-rules:
- text: 'shadow: declaration of "(err|ctx)" shadows declaration at'
linters: [ govet ]

0 comments on commit 3f0a846

Please sign in to comment.