From c53f30d1a177db49f89ee5fa2cc8b04f3ce7354e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E5=B0=8F=E9=BE=99?= Date: Tue, 16 Jul 2019 20:39:27 +0800 Subject: [PATCH] Add golangci-lint for formatting code (#21) * Add golangci-lint for formatting code --- .golangci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000000..272cc9a38c2ae --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,30 @@ +# Make sure golangci-lint is installed. +# https://github.com/golangci/golangci-lint#install +# We can execute `golangci-lint run` for code checking. +run: + tests: true + skip-dirs: + - _examples + +output: + print-issued-lines: false + +linters: + enable-all: true + disable: + - maligned + - megacheck + - lll + - gocyclo + - gochecknoglobals + +linters-settings: + govet: + check-shadowing: true + gocyclo: + min-complexity: 10 + dupl: + threshold: 100 + goconst: + min-len: 8 + min-occurrences: 3