Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-palyanitsa committed Jan 17, 2025
1 parent 28bfc0c commit 3382237
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ run:
# This file contains only configs which differ from defaults.
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
linters-settings:
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 12

cyclop:
# The maximal code complexity to report.
# Default: 10
Expand Down Expand Up @@ -232,7 +237,7 @@ linters:
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
- noctx # finds sending http request without context.Context
- nolintlint # reports ill-formed or insufficient nolint directives
- nonamedreturns # reports all named returns
# - nonamedreturns # reports all named returns
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
- perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative
- predeclared # finds code that shadows one of Go's predeclared identifiers
Expand Down
2 changes: 1 addition & 1 deletion expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (e *Expression) MatchIgnoreQuery(secondExpression Expression) (bool, error)
return e.match(secondExpression, true)
}

// nolint:gocyclo // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here
//nolint:gocyclo // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here

Check failure on line 365 in expression.go

View workflow job for this annotation

GitHub Actions / build

directive `//nolint:gocyclo // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here` is unused for linter "gocyclo" (nolintlint)
func (e *Expression) match(secondExpression Expression, ignoreQuery bool) (bool, error) {

Check failure on line 366 in expression.go

View workflow job for this annotation

GitHub Actions / build

cognitive complexity 46 of func `(*Expression).match` is high (> 30) (gocognit)
if e.AttributeSelector != "" {
return false, fmt.Errorf("matching of CTI with attribute selector is not supported")
Expand Down

0 comments on commit 3382237

Please sign in to comment.