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/[de]* #9379

Merged
merged 2 commits into from
Jun 21, 2021
Merged

Linter fixes for plugins/inputs/[de]* #9379

merged 2 commits into from
Jun 21, 2021

Conversation

zak-pawel
Copy link
Collaborator

Following findings were fixed:

plugins/inputs/dcos/client.go:236:57                             revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/dcos/client.go:262:23                             revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/dcos/client.go:276:52                             revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/dcos/client.go:321:25                             revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/dcos/client.go:322:2                              revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/dcos/dcos.go:355:2                                revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/directory_monitor/directory_monitor.go:278:43     revive       flag-parameter: parameter 'firstLine' seems to be a control flag, avoid control coupling
plugins/inputs/directory_monitor/directory_monitor_test.go:79:5  ineffassign  ineffectual assignment to err
plugins/inputs/disk/disk.go:18:2                                 revive       confusing-naming: Field 'MountPoints' differs only by capitalization to other field in the struct type DiskStats
plugins/inputs/disk/disk_test.go:113:2                           ineffassign  ineffectual assignment to err
plugins/inputs/disk/disk_test.go:118:2                           ineffassign  ineffectual assignment to err
plugins/inputs/disk/disk_test.go:1:9                             revive       import-shadowing: The name 'disk' shadows an import name
plugins/inputs/disk/disk_test.go:368:2                           ineffassign  ineffectual assignment to err
plugins/inputs/disk/disk_test.go:373:2                           ineffassign  ineffectual assignment to err
plugins/inputs/diskio/diskio.go:77:4                             revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/diskio/diskio_linux_test.go:110:8                 revive       defer: prefer not to defer chains of function calls
plugins/inputs/diskio/diskio_linux_test.go:98:3                  revive       defer: prefer not to defer inside loops
plugins/inputs/disque/disque.go:68:3                             revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/dns_query/dns_query.go:19:2                       staticcheck  SA9004: only the first constant in this group has an explicit type
plugins/inputs/docker/client.go:1:9                              revive       import-shadowing: The name 'docker' shadows an import name
plugins/inputs/docker/docker.go:1:9                              revive       import-shadowing: The name 'docker' shadows an import name
plugins/inputs/docker/docker.go:636:1                            revive       argument-limit: maximum number of arguments per function exceeded; max 6 but got 7
plugins/inputs/docker/docker.go:880:26                           revive       flag-parameter: parameter 'perDevice' seems to be a control flag, avoid control coupling
plugins/inputs/docker/docker.go:968:2                            revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/docker/docker.go:977:2                            revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/docker/docker.go:989:2                            revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/docker_log/docker_log.go:310:20                   revive       unnecessary-stmt: switch with only one case can be replaced by an if-then
plugins/inputs/docker_log/docker_log.go:424:2                    revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/docker_log/docker_log.go:433:2                    revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/docker_log/docker_log.go:445:2                    revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/ecs/ecs.go:223:2                                  revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/ecs/ecs.go:232:2                                  revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/ecs/ecs.go:253:2                                  revive       import-shadowing: The name 'filter' shadows an import name
plugins/inputs/elasticsearch/elasticsearch.go:647:8              revive       bool-literal-in-expr: omit Boolean literal in expression
plugins/inputs/elasticsearch/elasticsearch_test.go:209:2         revive       unexported-naming: the symbol IsMasterResultTokens is local, its name should start with a lowercase letter
plugins/inputs/elasticsearch/elasticsearch_test.go:247:2         revive       unexported-naming: the symbol IsNotMasterResultTokens is local, its name should start with a lowercase letter
plugins/inputs/ethtool/ethtool_linux.go:3:9                      revive       import-shadowing: The name 'ethtool' shadows an import name
plugins/inputs/ethtool/ethtool_test.go:38:3                      revive       bare-return: avoid using bare returns, please add return expressions
plugins/inputs/ethtool/ethtool_test.go:73:3                      revive       bare-return: avoid using bare returns, please add return expressions
plugins/inputs/eventhub_consumer/eventhub_consumer.go:1:9        revive       import-shadowing: The name 'eventhub' shadows an import name
plugins/inputs/exec/exec.go:1:9                                  revive       import-shadowing: The name 'exec' shadows an import name
plugins/inputs/execd/execd_test.go:142:39                        revive       import-shadowing: The name 'metric' 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.

Looks good to me.

I have only one general comment about flag-parameter: parameter 'perDevice' seems to be a control flag, avoid control coupling. I'm still not sure what a good replacement pattern is for those cases. Your "fix" is just a smart exploitation of the linter weaknesses, but you are still doing the same as before... :-)

@srebhan srebhan self-assigned this 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.

LGTM.

@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 18, 2021
@sspaink sspaink merged commit 9a79491 into influxdata:master Jun 21, 2021
reimda pushed a commit that referenced this pull request Jul 7, 2021
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 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