Skip to content

Commit

Permalink
adjust linter configuration
Browse files Browse the repository at this point in the history
make sure all actions use the same compiler version
  • Loading branch information
avarabyeu committed Mar 21, 2024
1 parent 225a92a commit a6c997a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 33 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
args:
--timeout=10m
--fast
--disable=errcheck
--disable=gas

- name: Go Tests
id: tests
Expand Down
36 changes: 13 additions & 23 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ linters-settings:
deny:
- pkg: io/ioutil
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
govet:
check-shadowing: true
golint:
min-confidence: 0.8
gocyclo:
min-complexity: 10
max-complexity: 12
maligned:
suggest-new: true
dupl:
threshold: 500
goconst:
Expand All @@ -31,6 +25,8 @@ linters-settings:
line-length: 140
goimports:
local-prefixes: github.com/reportportal/service-index
gci:
local-prefixes: github.com/reportportal/service-index
gocritic:
enabled-tags:
- performance
Expand All @@ -46,26 +42,20 @@ linters-settings:
- docStub

linters:
enable-all: true
presets:
- bugs
- comment
- complexity
- error
- format
- import
- metalinter
- performance
- unused
disable:
- prealloc
- gochecknoglobals
- gocyclo
- godot
- gocritic
- interfacer
- wsl
- funlen
- unused
- gomnd
- godot
- exhaustivestruct
- exhaustruct
- varnamelen
- gci
- nosnakecase
- ifshort
- scopelint
- depguard
run:
# default concurrency is a available CPU number
concurrency: 1
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ lint: checkstyle

fmt:
gofmt -l -w -s ${GOFILES_NOVENDOR}
goimports -local "github.com/reportportal/service-index" -l -w ${GOFILES_NOVENDOR}
gofumpt -l -w ${GOFILES_NOVENDOR}
goimports -local github.com/reportportal/service-index -w ${GOFILES_NOVENDOR}
gci write --skip-generated --section Standard --section Default --section "Prefix(github.com/reportportal/service-index)" ${GOFILES_NOVENDOR}

# Builds server
build:
Expand Down
4 changes: 1 addition & 3 deletions k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import (
log "github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"

// all auth types are supported
_ "k8s.io/client-go/plugin/pkg/client/auth"
_ "k8s.io/client-go/plugin/pkg/client/auth" // all auth types are supported
"k8s.io/client-go/rest"
)

Expand Down
13 changes: 9 additions & 4 deletions traefik/traefik.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package traefik
import (
"errors"
"fmt"
"github.com/vulcand/predicate"
"net/http"
"net/url"
"strings"
Expand All @@ -12,6 +11,7 @@ import (

"github.com/go-resty/resty/v2"
log "github.com/sirupsen/logrus"
"github.com/vulcand/predicate"
)

const (
Expand Down Expand Up @@ -284,13 +284,18 @@ func getPath(s string) (string, error) {
},
})
if err != nil {
return "", err
return "", errPathParsing
}
pr, err := p.Parse(s)
if err != nil {
return "", err
return "", errPathParsing
}
return pr.(string), nil
prefix, ok := pr.(string)
if !ok {
return "", errPathParsing
}

return prefix, nil
}

type RawData struct {
Expand Down
1 change: 1 addition & 0 deletions traefik/traefik_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func Test_getPath(t *testing.T) {
got, err := getPath(tt.args.s)
if (err != nil) != tt.wantErr {
t.Errorf("getPath() error = %v, wantErr %v", err, tt.wantErr)

return
}
if got != tt.want {
Expand Down

0 comments on commit a6c997a

Please sign in to comment.