Skip to content

Commit

Permalink
Add a golangci-lint configuration file (open-telemetry#18)
Browse files Browse the repository at this point in the history
Without the config, the linter wasn't even running gofmt…
  • Loading branch information
krnowak authored Apr 23, 2020
1 parent e4eb804 commit ec5be60
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ec5be60

Please sign in to comment.