Skip to content

Commit

Permalink
Adjust golangci rules
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-palyanitsa committed Jan 17, 2025
1 parent 3382237 commit 73353fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ linters-settings:
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 12
min-complexity: 13

cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 30
max-complexity: 45
# The maximal average package complexity.
# If it's higher than 0.0 (float) the check is enabled
# Default: 0.0
Expand Down Expand Up @@ -80,7 +80,7 @@ linters-settings:
# Checks the number of statements in a function.
# If lower than 0, disable the check.
# Default: 40
statements: 50
statements: 55
# Ignore comments when counting lines.
# Default false
ignore-comments: true
Expand Down
4 changes: 1 addition & 3 deletions 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:gocognit // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here
func (e *Expression) match(secondExpression Expression, ignoreQuery bool) (bool, error) {
if e.AttributeSelector != "" {
return false, fmt.Errorf("matching of CTI with attribute selector is not supported")
Expand Down Expand Up @@ -457,8 +457,6 @@ func (e *Expression) match(secondExpression Expression, ignoreQuery bool) (bool,
type DynamicParameterValues map[string]string

// InterpolateDynamicParameterValues interpolates dynamic parameter values into the Expression.
//
//nolint:funlen // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here
func (e *Expression) InterpolateDynamicParameterValues(values DynamicParameterValues) (Expression, error) {
var cpHead *Node
var cpPrevNode *Node
Expand Down
2 changes: 1 addition & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (p *Parser) parseVendorOrPackage(s string) (identifier string, tail string,
return val, s[i:], nil
}

//nolint:funlen,gocyclo // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here
//nolint:funlen,gocyclo,gocognit // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here
func (p *Parser) parseEntityNameAndVersion(s string) (name EntityName, ver Version, tail string, err error) {
if s == "" {
return "", Version{}, s, fmt.Errorf(`entity name cannot be empty`)
Expand Down

0 comments on commit 73353fc

Please sign in to comment.