Skip to content

Commit

Permalink
ci: disable noisy lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Mar 9, 2024
1 parent 90dd3bc commit 83e26d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ linters-settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
# Default: false
strict: true
#strict: true

inamedparam:
# Skips check for interface methods with only a single parameter.
Expand Down Expand Up @@ -228,12 +228,12 @@ linters:
- gocyclo # computes and checks the cyclomatic complexity of functions
- 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
Expand All @@ -244,9 +244,9 @@ 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
#- perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative
- predeclared # finds code that shadows one of Go's predeclared identifiers
- promlinter # checks Prometheus metrics naming via promlint
- protogetter # reports direct reads from proto message fields when getters should be used
Expand All @@ -260,7 +260,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
5 changes: 3 additions & 2 deletions enforcer_synced_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
package casbin

import (
"github.com/casbin/casbin/v2/errors"
"github.com/casbin/casbin/v2/util"
"sort"
"testing"
"time"

"github.com/casbin/casbin/v2/errors"
"github.com/casbin/casbin/v2/util"
)

func testEnforceSync(t *testing.T, e *SyncedEnforcer, sub string, obj interface{}, act string, res bool) {
Expand Down
1 change: 1 addition & 0 deletions rbac_api_with_domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package casbin

import (
"fmt"

"github.com/casbin/casbin/v2/constant"
)

Expand Down

0 comments on commit 83e26d3

Please sign in to comment.