Skip to content

Commit

Permalink
Fix golden lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
IKukhta committed Dec 17, 2024
1 parent df3b587 commit 2c97078
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 3m
tests: false
skip-dirs:
- rdt # skip generated code


# This file contains only configs which differ from defaults.
Expand Down Expand Up @@ -82,7 +85,7 @@ linters-settings:
gocognit:
# Minimal code complexity to report.
# Default: 30 (but we recommend 10-20)
min-complexity: 20
min-complexity: 30

gocritic:
# Settings passed to gocritic.
Expand Down Expand Up @@ -179,7 +182,6 @@ linters-settings:
# Default: false
all: true


linters:
disable-all: true
enable:
Expand All @@ -189,7 +191,7 @@ linters:
- govet # 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 # is a go vet on steroids, applying a ton of static analysis checks
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
#- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
- unused # checks for unused constants, variables, functions and types
## disabled by default
- asasalint # checks for pass []any as any in variadic func(...any)
Expand All @@ -207,25 +209,25 @@ linters:
- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
- gochecknoglobals # checks that no global variables exist
#- gochecknoglobals # checks that no global variables exist
- gochecknoinits # checks that no init functions are present in Go code
- gochecksumtype # checks exhaustiveness on Go "sum types"
- gocognit # computes and checks the cognitive complexity of functions
- goconst # finds repeated strings that could be replaced by a constant
- gocritic # provides diagnostics that check for bugs, performance and style issues
- gocyclo # computes and checks the cyclomatic complexity of functions
- godot # checks if comments end in a period
#- godot # checks if comments end in a period
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
- gomnd # detects magic numbers
#- gomnd # detects magic numbers
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
- goprintffuncname # checks that printf-like functions are named with f at the end
- gosec # inspects source code for security problems
- lll # reports long lines
#- lll # reports long lines
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
- makezero # finds slice declarations with non-zero initial length
- mirror # reports wrong mirror patterns of bytes/strings usage
- musttag # enforces field tags in (un)marshaled structs
#- musttag # enforces field tags in (un)marshaled structs
- nakedret # finds naked returns in functions greater than a specified function length
- nestif # reports deeply nested if statements
- nilerr # finds the code that returns nil even if it checks that the error is not nil
Expand All @@ -247,7 +249,7 @@ linters:
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
- testableexamples # checks if examples are testable (have an expected output)
- testifylint # checks usage of github.com/stretchr/testify
- testpackage # makes you use a separate _test package
#- testpackage # makes you use a separate _test package
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
Expand Down Expand Up @@ -313,6 +315,9 @@ issues:
max-same-issues: 50

exclude-rules:
- path: /
linters:
- typecheck
- source: "(noinspection|TODO)"
linters: [ godot ]
- source: "//noinspection"
Expand Down

0 comments on commit 2c97078

Please sign in to comment.