ci: adding config files

This commit is contained in:
Dave Hrycyszyn 2019-09-25 12:24:34 +01:00
parent c628a75c35
commit 43b899d164
2 changed files with 91 additions and 0 deletions

60
.golangci.yml Normal file
View File

@ -0,0 +1,60 @@
run:
concurrency: 6
deadline: 1m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor$
- build$
# skip-files:
# -
linters-settings:
govet:
check-shadowing: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
gocyclo:
min-complexity: 20
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 3
min-occurrences: 3
depguard:
list-type: whitelist
include-go-root: false
packages:
misspell:
locale: UK
# ignore-words:
# - foo
lll:
line-length: 120
unused:
check-exported: false
unparam:
check-exported: false
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
simple: true
range-loops: true # Report preallocation suggestions on range loops, true by default
for-loops: false # Report preallocation suggestions on for loops, false by default
gocritic:
disabled-checks:
- captLocal
linters:
enable-all: true
disable-all: false
# disable:
# - maligned
# - prealloc
# - gochecknoglobals
fast: false

31
.travis.yml Normal file
View File

@ -0,0 +1,31 @@
language: go
go:
- "1.12"
env:
- GO111MODULE=on
script:
- go test -v ./... -race -coverprofile=cover.out.tmp -covermode=atomic
after_success:
- cat cover.out.tmp | grep -v ".pb.go" > cover.out
- bash <(curl https://codecov.io/bash)
git:
depth: 1
notifications:
email:
recipients:
- dave@nymtech.net
- andrew@nymtech.net
on_success: change # always|never|change
on_failure: always
webhooks:
urls:
- "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGZ1dHVyZWNoaW1wJTNBbWF0cml4Lm9yZy8lMjFwUEVlaHVoZFlxTGVqU1VGSVIlM0FtYXRyaXgub3Jn"
on_success: change # always|never|change
on_failure: always
on_start: never