From ec5be60591bf9bcd99b046dc0dabbbfbe8c8d1aa Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 23 Apr 2020 22:16:16 +0200 Subject: [PATCH] Add a golangci-lint configuration file (#18) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the config, the linter wasn't even running gofmt… --- .golangci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000000..cef170f7c7f --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,32 @@ +# See https://github.com/golangci/golangci-lint#config-file +run: + issues-exit-code: 1 #Default + tests: true #Default + +linters: + enable: + - misspell + - goimports + - golint + - gofmt + +issues: + exclude-rules: + # helpers in tests often (rightfully) pass a *testing.T as their first argument + - path: _test\.go + text: "context.Context should be the first parameter of a function" + linters: + - golint + # Yes, they are, but it's okay in a test + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - golint + +linters-settings: + misspell: + locale: US + #ignore-words: + # - someword + goimports: + local-prefixes: go.opentelemetry.io