Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
- run: go mod download
- run: go build -v .
- name: Run Linters
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: latest
160 changes: 93 additions & 67 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,5 @@
# © Broadcom. All Rights Reserved.
# The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
# SPDX-License-Identifier: MPL-2.0

# For more information about the golangci-lint configuration file, refer to:
# https://golangci-lint.run/usage/configuration/

issues:
exclude-rules:
- path: _test\.go
linters:
- dogsled
- funlen
- gocognit
- path: internal/authctx
linters:
- gosec
- nestif
- path: flatten_test.go
linters:
- dupl

linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- copyloopvar
- dogsled
- dupl
- errcheck
- funlen
- goconst
- gocognit
- gocritic
- gocyclo
- godot
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nestif
- prealloc
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- wsl
---
version: "2"

run:
build-tags:
Expand Down Expand Up @@ -86,15 +32,95 @@ run:

output:
formats:
- format: colored-line-number
text:
path: stdout

linters-settings:
funlen:
lines: 150
statements: 100
gocognit:
min-complexity: 60
goimports:
local-prefixes: github.com/vmware/terraform-provider-tanzu-mission-control
nestif:
min-complexity: 14
linters:
default: none
enable:
- asciicheck
- bodyclose
- copyloopvar
- dogsled
- dupl
- errcheck
- funlen
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- goprintffuncname
- gosec
- govet
- ineffassign
- misspell
- nakedret
- nestif
- prealloc
- staticcheck
- unconvert
- unparam
- unused
- whitespace
- wsl
settings:
funlen:
lines: 150
statements: 100
gocognit:
min-complexity: 60
nestif:
min-complexity: 14
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# TODO: Setting temporary exclusions.
- linters:
- dogsled
- funlen
- gocognit
path: _test\.go
- linters:
- gosec
- nestif
path: internal/authctx
- linters:
- dupl
path: flatten_test.go
- linters:
- staticcheck
text: QF1001
- linters:
- staticcheck
text: QF1003
- linters:
- staticcheck
text: QF1007
- linters:
- staticcheck
text: QF1011
paths:
- third_party$
- builtin$
- examples$

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/vmware/terraform-provider-tanzu-mission-control
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$