#9 introduces linter
This commit is contained in:
parent
f0acb329f7
commit
5100c7ce77
3 changed files with 45 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -44,3 +44,7 @@ prof.mem
|
|||
# Goland files
|
||||
.idea/
|
||||
tmp/**
|
||||
|
||||
# Coverage Reports
|
||||
coverage_unit.out
|
||||
coverage_integration.out
|
||||
33
.golangci.yml
Normal file
33
.golangci.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
output:
|
||||
# sorts results by: filepath, line and column
|
||||
sort-results: true
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- revive # general purpose linter, drop-in replacement for golint + some extra
|
||||
- whitespace # checks for unnecessary newlines and trailing spaces
|
||||
- unconvert # check for unnecessary type conversions
|
||||
- promlinter # checks that prometheus metrics follow prometheus naming conventions, see https://prometheus.io/docs/practices/naming/
|
||||
- nilerr # checks for cases where a nil value is returned even though a checked error is non-nil
|
||||
- gofmt # basic gofmt + the simplification flag "-s"
|
||||
- unparam # reports unused function parameters
|
||||
- goimports # checks import statements are formatted according to the 'goimport' command
|
||||
|
||||
linters-settings:
|
||||
errcheck:
|
||||
ignore: Close
|
||||
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
- linters:
|
||||
- revive
|
||||
text: package-comments
|
||||
|
||||
run:
|
||||
|
||||
build-tags:
|
||||
- unit
|
||||
- integration
|
||||
|
||||
timeout: 2m
|
||||
8
Makefile
Normal file
8
Makefile
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
test.lint:
|
||||
golangci-lint run --config .golangci.yml --verbose ./...
|
||||
|
||||
test.unit:
|
||||
go test -coverprofile=coverage_unit.out -tags=unit ./...
|
||||
|
||||
test.integration:
|
||||
go test -coverprofile=coverage_integration.out -tags=integration ./...
|
||||
Loading…
Reference in a new issue