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:max-public-structs in plugins/inputs/[n-s]* #15878

Merged

Conversation

zak-pawel
Copy link
Collaborator

Summary

Address following findings for revive:max-public-structs in plugins/inputs/[n-s]*:

plugins/inputs/nginx_plus/nginx_plus.go:2:1                            revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/nginx_plus_api/nginx_plus_api_types.go:1:1              revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/nomad/nomad_metrics.go:1:1                              revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/nsq/nsq.go:24:1                                         revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/nvidia_smi/schema_v11/types.go:1:1                      revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/opensearch_query/aggregation.response.go:1:1            revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/proxmox/structs.go:1:1                                  revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/rabbitmq/rabbitmq.go:2:1                                revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/redfish/redfish.go:2:1                                  revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/rethinkdb/rethinkdb_data.go:1:1                         revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/sflow/types.go:1:1                                      revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/solr/types.go:1:1                                       revive  max-public-structs: you have exceeded the maximum number of public struct declarations
plugins/inputs/stackdriver/stackdriver.go:2:1                          revive  max-public-structs: you have exceeded the maximum number of public struct declarations

As proposed here #15822, we will fix the errors found by the following configuration:

      - name: max-public-structs
        exclude: ["TEST"]
        arguments: [5]

  # Excluding configuration per-path, per-linter, per-text and per-source
  exclude-rules:
    - path-except: ^plugins/(aggregators|inputs|outputs|parsers|processors|serializers)/...
      text: "max-public-structs: you have exceeded the maximum number of public struct declarations"

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

Checklist

  • No AI generated code was used in this PR

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!

@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 16, 2024
@srebhan srebhan removed their assignment Sep 16, 2024
@DStrand1 DStrand1 merged commit 714989a into influxdata:master Sep 16, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.32.1 milestone Sep 16, 2024
srebhan pushed a commit that referenced this pull request Oct 7, 2024
asaharn pushed a commit to asaharn/telegraf that referenced this pull request Oct 16, 2024
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