From 83a4571d1f4d994428692e46b3ceb99050d19142 Mon Sep 17 00:00:00 2001 From: Mateusz Szostok Date: Tue, 5 Feb 2019 18:39:54 +0100 Subject: [PATCH] Add golangci configuration --- .golangci.yml | 30 ++++++++++++++++++++++++++++++ internal/check/valid_owner.go | 5 +---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..c210652 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,30 @@ +run: + deadline: 5m + +linters: + disable-all: true + enable: + - dupl + - goconst + - gocyclo + - gofmt + - golint + - govet + - ineffassign + - interfacer + - lll + - misspell + - nakedret + - structcheck + - unparam + - varcheck + +linters-settings: + dupl: + threshold: 400 + lll: + line-length: 170 + gocyclo: + min-complexity: 15 + golint: + min-confidence: 0.85 \ No newline at end of file diff --git a/internal/check/valid_owner.go b/internal/check/valid_owner.go index 727dde6..64c06d1 100644 --- a/internal/check/valid_owner.go +++ b/internal/check/valid_owner.go @@ -191,11 +191,8 @@ func (v *ValidOwnerChecker) initOrgListMembers(ctx context.Context) error { func isEmailAddress(s string) bool { _, err := mail.ParseAddress(s) - if err != nil { - return false - } - return true + return err == nil } func isGithubTeam(s string) bool {