Skip to content

chore(lint): Add support for linter in mage #4817

chore(lint): Add support for linter in mage

chore(lint): Add support for linter in mage #4817

Triggered via pull request January 23, 2025 02:22
@simar7simar7
synchronize #2392
mage-lint
Status Failure
Total duration 4m 50s
Artifacts

build.yaml

on: pull_request
Run Operator envtest
0s
Run Operator envtest
Run integration tests
0s
Run integration tests
Run end to end testing
0s
Run end to end testing
Fit to window
Zoom out
Zoom in

Annotations

11 errors and 2 warnings
Run tests
Process completed with exit code 1.
Verify code: pkg/trivyoperator/config.go#L155
string `true` has 3 occurrences, make it a constant (goconst)
Verify code: pkg/trivyoperator/config.go#L208
emptyStringTest: replace `len(strings.TrimSpace(s)) == 0` with `strings.TrimSpace(s) == ""` (gocritic)
Verify code: pkg/kube/labels.go#L4
paramTypeCombine: func(configLabelsNames []string, resourceLabels map[string]string, reportLabels map[string]string) could be replaced with func(configLabelsNames []string, resourceLabels, reportLabels map[string]string) (gocritic)
Verify code: pkg/kube/labels.go#L13
paramTypeCombine: func(configCustomLabels map[string]string, reportLabels map[string]string) could be replaced with func(configCustomLabels, reportLabels map[string]string) (gocritic)
Verify code: pkg/kube/logs.go#L77
emptyStringTest: replace `len(matchingLabelValue) == 0` with `matchingLabelValue == ""` (gocritic)
Verify code: pkg/kube/secrets.go#L31
emptyStringTest: replace `len(wildcardDomain) > 0` with `wildcardDomain != ""` (gocritic)
Verify code: pkg/utils/dateutil_test.go#L34
boolExprSimplify: can simplify `!(int(duration.Hours()) > tt.wantDuration)` to `int(duration.Hours()) <= tt.wantDuration` (gocritic)
Verify code: pkg/operator/workload/helper.go#L131
paramTypeCombine: func(ctx context.Context, resolver kube.ObjectResolver, namespace string, resourceName string) error could be replaced with func(ctx context.Context, resolver kube.ObjectResolver, namespace, resourceName string) error (gocritic)
Verify code: pkg/operator/workload/helper.go#L155
paramTypeCombine: func(ctx context.Context, resolver kube.ObjectResolver, namespace string, resourceNameLabels map[string]string, annotation map[string]string) error could be replaced with func(ctx context.Context, resolver kube.ObjectResolver, namespace string, resourceNameLabels, annotation map[string]string) error (gocritic)
Verify code: pkg/operator/workload/helper.go#L172
paramTypeCombine: func(ctx context.Context, resolver kube.ObjectResolver, namespace string, resourceNameLabels map[string]string, annotation map[string]string) error could be replaced with func(ctx context.Context, resolver kube.ObjectResolver, namespace string, resourceNameLabels, annotation map[string]string) error (gocritic)
Run tests
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Verify code
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636