Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Sep 11, 2024
1 parent 162be8c commit fa20f33
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 33 deletions.
51 changes: 20 additions & 31 deletions golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ run:
# on Windows.
skip-dirs:

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: false

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
Expand All @@ -56,7 +52,7 @@ run:
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
formats: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand All @@ -71,29 +67,20 @@ output:
# all available settings of specific linters
linters-settings:
depguard:
# Check the list against standard lib.
# Default: false
include-go-root: true
# A list of packages for the list type specified.
# Default: []
packages:
- "crypto/md5"
- "crypto/sha1"
- "crypto/**/pkix"
ignore-file-rules:
- "**/*_test.go"
additional-guards:
# Do not allow testing packages in non-test files.
- list-type: denylist
include-go-root: true
packages:
- testing
- github.com/stretchr/testify
ignore-file-rules:
- "**/*_test.go"
- "**/*test/*.go"
- "**/testcase.go"
- "**/recordfixtures/*.go"
rules:
non-tests:
files:
- "!$test"
- "!**/testcase.go"
- "!**/*test/*.go"
- "!**/*recordfixtures/*.go"
- "!**/internal/matchers/*.go"
deny:
- pkg: "testing"
- pkg: "github.com/stretchr/testify"
- pkg: "crypto/md5"
- pkg: "crypto/sha1"
- pkg: "crypto/**/pkix"
godot:
exclude:
# Exclude sentence fragments for lists.
Expand All @@ -113,7 +100,7 @@ linters-settings:
min-confidence: 0.8
govet:
# report about shadowed variables
check-shadowing: true
shadow: true

# settings per analyzer
settings:
Expand Down Expand Up @@ -153,8 +140,9 @@ linters-settings:
- name: constant-logical-expr
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument
# TODO reenable linter when it is compatible. https://github.com/golangci/golangci-lint/issues/3280
- name: context-as-argument
disabled: false
disabled: true
arguments:
allowTypesBefore: "*testing.T"
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type
Expand Down Expand Up @@ -292,7 +280,7 @@ linters:
enable:
- depguard
- errcheck
- exportloopref
- copyloopvar
- godot
- gofmt
- goimports
Expand Down Expand Up @@ -322,3 +310,4 @@ issues:
- path: \.pb\.go
linters:
- govet
exclude-dirs-use-default: false
3 changes: 1 addition & 2 deletions internal/resourcemapping/resourcemapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ func commonResourceAttributesToMonitoredResource(cloudPlatform string, attrs Rea
return createMonitoredResource(k8sPod, attrs)
} else if _, ok := attrs.GetString(string(semconv.K8SNodeNameKey)); ok {
return createMonitoredResource(k8sNode, attrs)
} else {
return createMonitoredResource(k8sCluster, attrs)
}
return createMonitoredResource(k8sCluster, attrs)

Check warning on line 225 in internal/resourcemapping/resourcemapping.go

View check run for this annotation

Codecov / codecov/patch

internal/resourcemapping/resourcemapping.go#L225

Added line #L225 was not covered by tests
}

// Fallback to generic_task
Expand Down

0 comments on commit fa20f33

Please sign in to comment.