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(linters): Enable import-alias-naming and redundant-import-alias rules for revive #15836

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

zak-pawel
Copy link
Collaborator

Summary

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15820
resolves #15825

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 for this epic effort @zak-pawel! I do have some comments in the code, but in general there are two things

  1. How about fixing variable naming instead of using an alias e.g. for github.com/influxdata/telegraf/config? The variable can easily be named cfg without issues...
  2. I love your consistent aliases for internal things like common_tls, internal_whatever etc. but you deviate for influx_serializer, influx_parser or jsonparser. How about also following the pattern and use serializers_influx, parsers_influx and parsers_json instead?

plugins/aggregators/histogram/histogram.go Outdated Show resolved Hide resolved
plugins/aggregators/histogram/histogram_test.go Outdated Show resolved Hide resolved
plugins/common/kafka/config.go Outdated Show resolved Hide resolved
plugins/common/shim/config_test.go Outdated Show resolved Hide resolved
plugins/inputs/aerospike/aerospike.go Outdated Show resolved Hide resolved
plugins/inputs/p4runtime/p4runtime_test.go Outdated Show resolved Hide resolved
plugins/inputs/vault/vault_test.go Outdated Show resolved Hide resolved
plugins/outputs/dynatrace/dynatrace.go Outdated Show resolved Hide resolved
testutil/container.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

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

It improves overall code readability, but still have some suggestions:

plugins/common/proxy/connect.go Show resolved Hide resolved
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt.go Outdated Show resolved Hide resolved
plugins/inputs/cloudwatch/cloudwatch.go Outdated Show resolved Hide resolved
plugins/inputs/docker/docker.go Outdated Show resolved Hide resolved
plugins/inputs/gnmi/update_fields.go Outdated Show resolved Hide resolved
plugins/outputs/dynatrace/dynatrace.go Outdated Show resolved Hide resolved
plugins/outputs/http/http.go Outdated Show resolved Hide resolved
testutil/container.go Outdated Show resolved Hide resolved
testutil/metric.go Outdated Show resolved Hide resolved
plugins/inputs/p4runtime/p4runtime.go Outdated Show resolved Hide resolved
plugins/inputs/p4runtime/p4runtime_fake_client_test.go Outdated Show resolved Hide resolved
plugins/inputs/p4runtime/p4runtime_test.go Outdated Show resolved Hide resolved
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt.go Outdated Show resolved Hide resolved
plugins/common/proxy/connect.go 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 @zak-pawel! Just two more comments and I think we are good...

plugins/inputs/kafka_consumer/kafka_consumer_test.go Outdated Show resolved Hide resolved
testutil/metric.go 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.

Epic! Thanks a lot @zak-pawel for your work!

@srebhan srebhan 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 Sep 5, 2024
@srebhan srebhan removed their assignment Sep 5, 2024
…as-naming_redundant-import-alias

# Conflicts:
#	plugins/outputs/exec/exec_test.go
#	plugins/outputs/prometheus_client/v1/collector.go
#	plugins/outputs/prometheus_client/v2/collector.go
…as-naming_redundant-import-alias

# Conflicts:
#	plugins/inputs/logstash/logstash.go
…as-naming_redundant-import-alias

# Conflicts:
#	plugins/inputs/aerospike/aerospike.go
#	plugins/inputs/gnmi/gnmi.go
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
4 participants