diff --git a/.golangci.goheader.template b/.golangci.goheader.template new file mode 100644 index 0000000..947c941 --- /dev/null +++ b/.golangci.goheader.template @@ -0,0 +1,13 @@ +Copyright © {{ copyright-year }} Meroxa, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..460698b --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,115 @@ +run: + timeout: 3m + +linters-settings: + gofmt: + simplify: false + govet: + check-shadowing: false # TODO enable + nolintlint: + allow-unused: false # report any unused nolint directives + require-explanation: true # require an explanation for nolint directives + require-specific: true # require nolint directives to mention the specific linter being suppressed + gocyclo: + min-complexity: 20 + goconst: + ignore-tests: true + goheader: + template-path: '.golangci.goheader.template' + values: + regexp: + copyright-year: 20[2-9]\d + +issues: + exclude-rules: + - path: '(.+)acceptance_testing\.go' + linters: + - stylecheck + text: "ST1003: should not use underscores in Go names" + # Exclude some linters from running on tests files. + - path: _test\.go + linters: + - dogsled + - gosec + +linters: + # please, do not use `enable-all`: it's deprecated and will be removed soon. + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint + disable-all: true + enable: + # We plan to enable all of the linters which are commented out. + # However, we want to enable them one by one (so we don't have to fix many issues at once). + - bodyclose + # - depguard + - dogsled + - durationcheck + - errcheck + - errname + # - errorlint + # - exhaustive + # - exhaustivestruct + - exportloopref + # - forbidigo + # - forcetypeassert + # - funlen + # - gochecknoinits + - goconst + - gocritic + - gocyclo + # - cyclop # not interested in package complexities at the moment + # - godot + - gofmt + # - gofumpt + - goheader + - goimports + - revive + # - gomnd + - gomoddirectives + - gomodguard + - goprintffuncname + - gosec + - gosimple + - govet + # - ifshort + - ineffassign + # - importas + # - lll + # - misspell + - makezero + # - nakedret + # - nilerr + # - nilnil + # - nlreturn + - noctx + - nolintlint + # - paralleltest + - predeclared + - rowserrcheck + - staticcheck + - stylecheck + - sqlclosecheck + # - tagliatelle + # - tenv + # - thelper + # - tparallel + - typecheck + - unconvert + # - unparam + - unused + - wastedassign + - whitespace + # - wrapcheck + # - wsl + + # don't enable: + # - asciicheck + # - dupl + # - gochecknoglobals + # - gocognit + # - godox + # - goerr113 + # - maligned + # - nestif + # - prealloc + # - testpackage + # - wsl diff --git a/Makefile b/Makefile index 06206ab..acef1fd 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,3 @@ install-tools: .PHONY: generate generate: go generate ./... - -test: - go test $(GOTEST_FLAGS) -race ./... diff --git a/serve/serve.go b/serve/serve.go index 6bfb406..dd18c4a 100644 --- a/serve/serve.go +++ b/serve/serve.go @@ -16,6 +16,7 @@ package serve import ( "fmt" + "github.com/conduitio/conduit-processor-sdk" "github.com/conduitio/conduit-processor-sdk/internal" "github.com/goccy/go-json"