Skip to content

Commit

Permalink
Update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
siller174 committed Apr 11, 2023
1 parent a91de3b commit 58b91bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
41 changes: 15 additions & 26 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# More info on config here: https://github.com/golangci/golangci-lint#config-file
run:
deadline: 10s
timeout: 5m
timeout: 10m
issues-exit-code: 1
tests: true
skip-dirs:
Expand All @@ -12,7 +10,6 @@ run:
skip-files:
- \.pb\.go$
- \.pb\.goclay\.go$
- \_test.go$

output:
format: colored-line-number
Expand All @@ -22,8 +19,6 @@ output:
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
dupl:
threshold: 100
goconst:
Expand All @@ -33,39 +28,33 @@ linters-settings:
linters:
disable-all: true
enable:
- revive
- govet
- errcheck
- deadcode
- structcheck
- varcheck
- ineffassign
- typecheck
- goconst
- gosec
- goimports
- gosec
- govet
- ineffassign
- megacheck

- revive
- typecheck
- unused # will be used insted of varcheck + deadcode + structcheck. More info https://github.com/golangci/golangci-lint/issues/1841
- exportloopref
- ifshort
- prealloc
- wsl

issues:
exclude-use-default: false
exclude:
# _ instead of err checks
- G104
- G306
# md5 using for hash generation, not for security, so ignore this
- G401
- G501
# for "public interface + private struct implementation" cases only!
- exported func * returns unexported type *, which can be annoying to use
- exported func .* returns unexported type .*, which can be annoying to use
# can be removed in the development phase
# - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
# not for the active development - can be removed in the stable phase
- should have a package comment, unless it's in another file for this package
- should have a package comment
- don't use an underscore in package name
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv|.*Rollback). is not checked
# EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
- should check returned error before deferring
- should have comment or be unexported
- a blank import should be only in a main or test package
- Can't process result by diff processor
1 change: 1 addition & 0 deletions errors/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type assertError struct {
fields map[string]interface{}
}

// NewAssertError ...
func NewAssertError(name string, message string, actual interface{}, expected interface{}) error {
return &assertError{
name: name,
Expand Down

0 comments on commit 58b91bd

Please sign in to comment.