From ccd468b06cd8bc93096fa1b3d363bc9c6ac5d735 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Fri, 8 Dec 2023 21:05:35 -0500 Subject: [PATCH] Update golangci config to newer style (same as TF provider) --- .github/workflows/ci.yml | 2 +- .golangci.yml | 88 +++++----------------------------------- 2 files changed, 11 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a247a56..31bb67e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: run: make lint - name: Vet - run: make vet + run: go vet ./... - name: Tidy run: go mod tidy diff --git a/.golangci.yml b/.golangci.yml index c7799b4..517393c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,91 +1,23 @@ run: tests: false + timeout: 10m linters-settings: - errcheck: - check-type-assertions: true - check-blank: true + revive: + rules: + - name: unused-parameter + severity: warning + disabled: true - govet: - check-shadowing: true + gomoddirectives: + replace-allow-list: + - github.com/linode/linodego - enable: - - atomicalign - enable-all: false + govet: disable: - shadow - disable-all: false - golint: - min-confidence: 0.8 - gocyclo: - min-complexity: 30 - gocognit: - min-complexity: 30 - maligned: - suggest-new: true dupl: threshold: 100 linters: - enable-all: true - disable: - # deprecated linters - - deadcode - - ifshort - - varcheck - - nosnakecase - #################### - - # conflicted with go fmt - - nolintlint - - # workaround to avoid linter failures of getting malformed json - - musttag - - - bodyclose - - contextcheck - - nilerr - - noctx - - rowserrcheck - - sqlclosecheck - - structcheck - - tparallel - - vetshadow - - errname - - forcetypeassert - - gocyclo - - unparam - - nakedret - - lll - - golint - - maligned - - scopelint - - dupl - - gosec - - gochecknoinits - - gochecknoglobals - - exhaustruct - - nonamedreturns - - errcheck - - staticcheck - - stylecheck - - wsl - - interfacer - - varnamelen - - tagliatelle - - gomnd - - nlreturn - - wrapcheck - - wastedassign - - goerr113 - - exhaustivestruct - - durationcheck - - errorlint - - cyclop - - godot - - exhaustive - - depguard - - tagalign - - inamedparam - - godox fast: false