Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix linter findings for revive:enforce-slice-style in plugins/parsers, plugins/processors, plugins/secretstores and plugins/serializers #15980

Conversation

zak-pawel
Copy link
Collaborator

@zak-pawel zak-pawel commented Oct 4, 2024

Summary

Address findings for revive:enforce-slice-style in plugins/parsers, plugins/processors, plugins/secretstores and plugins/serializers.

As we agreed here #15812, we will fix the errors found by the following configuration:

      - name: enforce-slice-style
        arguments: ["make"]

It is only part of the bigger job.
After all findings of this type in whole project are handled, we can enable revive:enforce-slice-style rule in golangci-lint.

Checklist

  • No AI generated code was used in this PR

…ns/parsers`, `plugins/processors`, `plugins/secretstores` and `plugins/serializers`
@DStrand1 DStrand1 removed their assignment Oct 7, 2024
@DStrand1 DStrand1 added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Oct 7, 2024
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I wonder if you can leave out all the make([]xyz, 0) statements in the tests to simplify the code!?

plugins/parsers/collectd/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/csv/parser.go Outdated Show resolved Hide resolved
plugins/parsers/csv/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/influx/influx_upstream/parser.go Outdated Show resolved Hide resolved
plugins/parsers/influx/influx_upstream/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/influx/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/json/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/json/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/json_v2/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/logfmt/parser_test.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some more instances that can be removed IMO...

plugins/parsers/csv/parser_test.go Outdated Show resolved Hide resolved
plugins/parsers/value/parser.go Outdated Show resolved Hide resolved
plugins/parsers/xpath/parser.go Outdated Show resolved Hide resolved
plugins/parsers/xpath/parser_test.go Outdated Show resolved Hide resolved
plugins/processors/aws_ec2/ec2_test.go Outdated Show resolved Hide resolved
plugins/secretstores/http/decryption_test.go Outdated Show resolved Hide resolved
plugins/serializers/graphite/graphite.go Outdated Show resolved Hide resolved
plugins/serializers/json/json.go Outdated Show resolved Hide resolved
plugins/serializers/json/json.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one last suggestion @zak-pawel! ;-)

plugins/processors/starlark/starlark_test.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @zak-pawel!

@srebhan srebhan merged commit f8af593 into influxdata:master Oct 15, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.32.2 milestone Oct 15, 2024
asaharn pushed a commit to asaharn/telegraf that referenced this pull request Oct 16, 2024
…ns/parsers`, `plugins/processors`, `plugins/secretstores` and `plugins/serializers` (influxdata#15980)
srebhan pushed a commit that referenced this pull request Oct 28, 2024
…ns/parsers`, `plugins/processors`, `plugins/secretstores` and `plugins/serializers` (#15980)

(cherry picked from commit f8af593)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore linter ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants