Skip to content

Commit

Permalink
Merge pull request #8 from hypnoglow/add-linter
Browse files Browse the repository at this point in the history
Add linter
  • Loading branch information
hypnoglow authored Oct 25, 2020
2 parents 9648e67 + d6464e0 commit 9dfbe7c
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
go mod download
go mod vendor
- name: Run linters
uses: golangci/golangci-lint-action@v2
with:
version: v1.31

- name: Build
run: |
go build -o ./bin/terraform-provider-oryhydra
48 changes: 48 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
run:
concurrency: 4
timeout: 5m

linters:
disable-all: true
enable:
- deadcode
- depguard
- errcheck
- gci
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- maligned
- misspell
- nakedret
# - prealloc
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck

linters-settings:
goimports:
local-prefixes: github.com/hypnoglow/terraform-provider-oryhydra

issues:
exclude-rules:
- linters:
- errcheck
text: Error return value of `d.Set` is not checked
- linters:
- gocritic
text: ^singleCaseSwitch
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ build:
.PHONY: prepare-examples
prepare-examples:
@ln -s $(shell pwd)/bin/terraform-provider-oryhydra ./examples/oryhydra_oauth2_client/terraform-provider-oryhydra

.PHONY: lint
lint:
@golangci-lint run
8 changes: 2 additions & 6 deletions oryhydra/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ type logger interface {

type nopLogger struct{}

func (n nopLogger) Print(v ...interface{}) {
return
}
func (n nopLogger) Print(v ...interface{}) {}

func (n nopLogger) Printf(format string, v ...interface{}) {
return
}
func (n nopLogger) Printf(format string, v ...interface{}) {}

0 comments on commit 9dfbe7c

Please sign in to comment.