CI: add config circleci

master
fbonhomm 2019-09-15 16:33:52 +02:00
parent 6907547fde
commit bd1d86f8c1
2 changed files with 99 additions and 0 deletions

27
.circleci/config.yml Normal file
View File

@ -0,0 +1,27 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/fbonhomm/api-go
docker:
- image: circleci/golang:1.13
steps:
- checkout
- run:
name: install all dependencies
command: 'go get ./...'
- run:
name: install golangci-lint and testify
command: 'go get -u github.com/golangci/golangci-lint/cmd/golangci-lint;go get -u github.com/stretchr/testify'
- run:
name: linter
command: '/go/bin/golangci-lint run -c ./.golangci.yml ./source/...'
- run:
name: build
command: 'go build'
- run:
name: unit test
command: 'go test -v ./test/unit/*.go'
- run:
name: functional test
command: 'go test -v ./test/functional/*.go'

72
.golangci.yml Normal file
View File

@ -0,0 +1,72 @@
run:
tests: true
skip-dirs:
- ressource
# modules-download-mode: readonly
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
govet:
check-shadowing: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
golint:
min-confidence: 0.8
gofmt:
simplify: true
goimports:
local-prefixes: github.com/fbonhomm/LZSS/source
gocyclo:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/davecgh/go-spew/spew
misspell:
locale: US
lll:
line-length: 120
nakedret:
max-func-lines: 40
prealloc:
simple: true
range-loops: true
for-loops: false
gocritic:
enabled-tags:
- performance
- style
- experimental
linters:
enable-all: true
disable:
- maligned
- prealloc
- gochecknoglobals
issues:
exclude-rules:
- text: "weak cryptographic primitive"
linters:
- gosec