Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #79

Merged
merged 4 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ name: "CodeQL Advanced"

on:
push:
branches: [ "*" ]
branches: [ "main" ]
pull_request:
branches: [ "*" ]
branches: [ "main" ]
schedule:
- cron: '27 11 * * 0'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Go

on:
push:
branches: [ "*" ]
branches: [ "main" ]
pull_request:
branches: [ "*" ]
branches: [ "main" ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ linters-settings:
nolintlint:
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: [ funlen, gocognit, lll ]
allow-no-explanation: [ funlen, gocognit, lll, nestif ]
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: true
Expand Down Expand Up @@ -232,7 +232,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
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
5 changes: 4 additions & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func (p *Parser) MustParse(input string) Expression {
return expr
}

//nolint:funlen,gocognit // func implements an alg with well-defined concrete purpose, so high cyclomatic complexity is ok here
func (p *Parser) parseExpression(s string, params parserParams) (Expression, error) {
if !strings.HasPrefix(s, "cti.") {
return emptyExpression, ErrNotExpression
Expand Down Expand Up @@ -228,6 +229,7 @@ func (p *Parser) parseExpression(s string, params parserParams) (Expression, err
var tail *Node

for s != "" {
//nolint:nestif
if head != nil {
if tail.HasWildcard() {
return emptyExpression, fmt.Errorf(`expression may have wildcard "%c" only at the end`, Wildcard)
Expand Down Expand Up @@ -401,7 +403,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,cyclop // 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 Expand Up @@ -451,6 +453,7 @@ loop:
}

case s[i] == Wildcard:
//nolint:nestif
if i > 0 {
//nolint:gocritic // if-else if more readable here than nested switch.
if minorIdx != -1 {
Expand Down
Loading