From bd1d86f8c1655a7ff11b4f18b1a0ae95760b02da Mon Sep 17 00:00:00 2001 From: fbonhomm Date: Sun, 15 Sep 2019 16:33:52 +0200 Subject: [PATCH] CI: add config circleci --- .circleci/config.yml | 27 +++++++++++++++++ .golangci.yml | 72 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 .golangci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..fc76c47 --- /dev/null +++ b/.circleci/config.yml @@ -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' + diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..d9c6f4d --- /dev/null +++ b/.golangci.yml @@ -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