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

Linter fixes for plugins/inputs/[fg]* #9387

Merged
merged 3 commits into from
Jul 27, 2021
Merged

Linter fixes for plugins/inputs/[fg]* #9387

merged 3 commits into from
Jul 27, 2021

Conversation

zak-pawel
Copy link
Collaborator

Following findings were fixed:

plugins/inputs/fail2ban/fail2ban_test.go:106:3            revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/fail2ban/fail2ban_test.go:112:3            revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/fail2ban/fail2ban_test.go:117:4            revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/fail2ban/fail2ban_test.go:121:4            revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/fail2ban/fail2ban_test.go:125:4            revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/fail2ban/fail2ban_test.go:130:2            revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/file/file_test.go:102:2                    ineffassign  ineffectual assignment to err
plugins/inputs/file/file_test.go:22:6                     ineffassign  ineffectual assignment to err
plugins/inputs/filecount/filesystem_helpers_test.go:56:2  staticcheck  SA4006: this value of `fileInfo` is never used
plugins/inputs/filecount/filesystem_helpers_test.go:59:2  staticcheck  SA4006: this value of `fileInfo` is never used
plugins/inputs/filestat/filestat.go:117:5                 revive       import-shadowing: The name 'md5' shadows an import name
plugins/inputs/filestat/filestat_test.go:201:2            ineffassign  ineffectual assignment to md5
plugins/inputs/fluentd/fluentd.go:66:3                    revive       bare-return: avoid using bare returns, please add return expressions
plugins/inputs/fluentd/fluentd.go:70:2                    nakedret     naked return in func `parse` with 10 lines of code
plugins/inputs/fluentd/fluentd_test.go:129:14             ineffassign  ineffectual assignment to err
plugins/inputs/github/github.go:184:1                     revive       confusing-results: unnamed results of the same type may be confusing, consider using named results
plugins/inputs/github/github.go:1:9                       revive       import-shadowing: The name 'github' shadows an import name
plugins/inputs/gnmi/gnmi.go:136:13                        revive       import-shadowing: The name 'path' shadows an import name
plugins/inputs/gnmi/gnmi.go:1:9                           revive       import-shadowing: The name 'gnmi' shadows an import name
plugins/inputs/gnmi/gnmi.go:328:9                         revive       import-shadowing: The name 'metric' shadows an import name
plugins/inputs/gnmi/gnmi.go:390:27                        revive       import-shadowing: The name 'path' shadows an import name
plugins/inputs/gnmi/gnmi.go:438:31                        revive       import-shadowing: The name 'path' shadows an import name
plugins/inputs/gnmi/gnmi.go:54:2                          revive       confusing-naming: Field 'aliases' differs only by capitalization to other field in the struct type GNMI
plugins/inputs/gnmi/gnmi_test.go:1:9                      revive       import-shadowing: The name 'gnmi' shadows an import name

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jun 16, 2021
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.

Hey @zak-pawel, nice batch of fixes! The only request (despite a cosmetic comment) I have is to not silence the gnmi.Error deprecation error as this needs real fixing!

@srebhan srebhan self-assigned this Jun 18, 2021
@srebhan srebhan added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Jun 18, 2021
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.

Perfect. Thanks!

@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 Jun 22, 2021
@@ -424,10 +424,10 @@ func TestSubscribeResponseError(t *testing.T) {
ml := &MockLogger{}
plugin := &GNMI{Log: ml}
// TODO: FIX SA1019: gnmi.Error is deprecated: Do not use.
errorResponse := &gnmi.SubscribeResponse_Error{Error: &gnmi.Error{Message: me, Code: mc}}
plugin.handleSubscribeResponse("127.0.0.1:0", &gnmi.SubscribeResponse{Response: errorResponse})
errorResponse := &gnmiLib.SubscribeResponse_Error{Error: &gnmiLib.Error{Message: me, Code: mc}}
Copy link
Contributor

Choose a reason for hiding this comment

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

up to you on whether you want to address this deprecation notice

Copy link
Collaborator Author

@zak-pawel zak-pawel Jul 27, 2021

Choose a reason for hiding this comment

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

@ssoroka we agreed with @srebhan that it should be handled by someone with better gnmi knowledge and we leave it as it is for now.

@reimda reimda merged commit 87c94e4 into influxdata:master Jul 27, 2021
reimda pushed a commit that referenced this pull request Jul 28, 2021
phemmer added a commit to phemmer/telegraf that referenced this pull request Aug 13, 2021
* origin/master: (183 commits)
  fix: CrateDB replace dots in tag keys with underscores (influxdata#9566)
  feat: Pull metrics from multiple AWS CloudWatch namespaces (influxdata#9386)
  fix: improve Clickhouse corner cases for empty recordset in aggregation queries, fix dictionaries behavior (influxdata#9401)
  fix(opcua): clean client on disconnect so that connect works cleanly (influxdata#9583)
  fix: Refactor ec2 init for config-api (influxdata#9576)
  fix: sort logs by timestamp before writing to Loki (influxdata#9571)
  fix: muting tests for udp_listener (influxdata#9578)
  fix: Do not return on disconnect to avoid breaking reconnect (influxdata#9524)
  fix: Fixing k8s nodes and pods parsing error (influxdata#9581)
  feat: OpenTelemetry output plugin (influxdata#9228)
  feat: Support AWS Web Identity Provider (influxdata#9411)
  fix: upgraded sensu/go to v2.9.0 (influxdata#9577)
  fix: Normalize unix socket path (influxdata#9554)
  docs: fix aws ec2 readme inconsistency (influxdata#9567)
  feat: Modbus Rtu over tcp enhancement (influxdata#9570)
  docs: information on new conventional commit format (influxdata#9573)
  docs: Add logo (influxdata#9574)
  docs: Adding links to net_irtt and dht_sensor external plugins (influxdata#9569)
  Upgrade hashicorp/consul/api to 1.9.1 (influxdata#9565)
  Update vmware/govmomi to v0.26.0 (influxdata#9552)
  Do not skip good quality nodes after a bad quality node is encountered (influxdata#9550)
  fix test so it hits a fake service (influxdata#9564)
  Update changelog
  Fix procstat plugin README to match sample config (influxdata#9553)
  Fix metrics reported as written but not actually written  (influxdata#9526)
  Prevent segfault in persistent volume claims (influxdata#9549)
  Update procstat to support cgroup globs & include systemd unit children (Copy of influxdata#7890) (influxdata#9488)
  Fix attempt to connect to an empty list of servers. (influxdata#9503)
  Fix handling bool in sql input plugin (influxdata#9540)
  Suricata alerts (influxdata#9322)
  Linter fixes for plugins/inputs/[fg]* (influxdata#9387)
  For Prometheus Input add ability to query Consul Service catalog (influxdata#5464)
  Support Landing page on Prometheus landing page (influxdata#8641)
  [Docs] Clarify tagging behavior (influxdata#9461)
  Change the timeout from all queries to per query (influxdata#9471)
  Attach the pod labels to the `kubernetes_pod_volume` & `kubernetes_pod_network` metrics. (influxdata#9438)
  feat(http_listener_v2): allows multiple paths and add path_tag (influxdata#9529)
  Bug Fix Snmp empty metric name (influxdata#9519)
  Worktable workfile stats (influxdata#8587)
  Update Go to v1.16.6 (influxdata#9542)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin linter plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins 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.

4 participants