Skip to content

Commit

Permalink
Improved static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
bcessa committed Mar 15, 2021
1 parent 922a5a2 commit cef26fd
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Static analysis
uses: golangci/golangci-lint-action@v2.4.0
with:
version: v1.32
version: v1.38

# Run unit tests
- name: Test
Expand Down
58 changes: 47 additions & 11 deletions .golangci.yml
@@ -1,5 +1,5 @@
run:
deadline: 2m
deadline: 5m
issues-exit-code: 1
tests: true
build-tags: []
Expand Down Expand Up @@ -32,7 +32,6 @@ linters:
- typecheck
- varcheck
- gocyclo
- maligned
- goconst
- depguard
- misspell
Expand All @@ -43,13 +42,27 @@ linters:
- scopelint
- bodyclose
- stylecheck
- interfacer
- unparam
- durationcheck
- unconvert
- asciicheck
- errorlint
- exhaustive
- exportloopref
- forcetypeassert
- godot
- ifshort
- noctx
- predeclared
- scopelint
- wastedassign
- whitespace
#- wrapcheck
#- nestif
#- funlen
disable:
- deadcode
- gocognit
- goimports
- unused
disable:
- dupl
issues:
exclude-use-default: false
Expand All @@ -63,24 +76,42 @@ issues:
- lll
- nakedret
- scopelint
- funlen
- nestif
- noctx
linters-settings:
errcheck:
check-type-assertions: true
check-blank: false
govet:
check-shadowing: false
enable:
- atomic
- atomicalign
- buildtag
- cgocall
- composites
- copylocks
- httpresponse
- loopclosure
- lostcancel
- nilfunc
- shift
- structtag
- unmarshal
- unreachable
- unusedresult
- tests
#- fieldalignment
golint:
min-confidence: 0.8
set-exit-status: true
gofmt:
simplify: true
gocyclo:
min-complexity: 18
maligned:
suggest-new: true
goconst:
min-len: 3
min-occurrences: 3
min-occurrences: 5
depguard:
list-type: blacklist
include-go-root: false
Expand All @@ -98,4 +129,9 @@ linters-settings:
range-loops: true
for-loops: false
dupl:
threshold: 150
threshold: 150
exhaustive:
default-signifies-exhaustive: true
funlen:
lines: 90
statements: 70
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -43,8 +43,8 @@ ca-roots:
@docker cp ca-roots:/ca-roots.crt ca-roots.crt
@docker stop ca-roots

## clean: Download and compile all dependencies and intermediary products
clean:
## deps: Download and compile all dependencies and intermediary products
deps:
@-rm -rf vendor
go mod tidy
go mod verify
Expand Down

0 comments on commit cef26fd

Please sign in to comment.