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

fix: Linter fixes for plugins/inputs/p* #10066

Merged
merged 8 commits into from
Nov 15, 2021
Merged

fix: Linter fixes for plugins/inputs/p* #10066

merged 8 commits into from
Nov 15, 2021

Conversation

zak-pawel
Copy link
Collaborator

Following findings were fixed:

plugins/inputs/phpfpm/fcgi_client.go:45:3                            revive       bare-return: avoid using bare returns, please add return expressions
plugins/inputs/phpfpm/fcgi_client.go:50:3                            revive       bare-return: avoid using bare returns, please add return expressions
plugins/inputs/phpfpm/fcgi_client.go:55:4                            revive       bare-return: avoid using bare returns, please add return expressions
plugins/inputs/phpfpm/fcgi_client.go:85:2                            nakedret     naked return in func `Request` with 50 lines of code
plugins/inputs/phpfpm/phpfpm.go:279:9                                revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/phpfpm/phpfpm.go:293:21                               revive       import-shadowing: The name 'url' shadows an import name
plugins/inputs/phpfpm/phpfpm.go:315:1                                revive       confusing-results: unnamed results of the same type may be confusing, consider using named results
plugins/inputs/ping/ping.go:276:41                                   unconvert    unnecessary conversion
plugins/inputs/ping/ping_notwindows.go:168:1                         revive       function-result-limit: maximum number of return results per function exceeded; max 3 but got 8
plugins/inputs/ping/ping_notwindows.go:194:1                         revive       confusing-results: unnamed results of the same type may be confusing, consider using named results
plugins/inputs/ping/ping_notwindows.go:197:2                         staticcheck  SA4009(related information): assignment to trans
plugins/inputs/ping/ping_notwindows.go:212:1                         revive       function-result-limit: maximum number of return results per function exceeded; max 3 but got 5
plugins/inputs/ping/ping_notwindows.go:217:2                         staticcheck  SA4009(related information): assignment to min
plugins/inputs/ping/ping_test.go:154:2                               dogsled      declaration has 7 blank identifiers
plugins/inputs/postfix/postfix.go:36:1                               revive       function-result-limit: maximum number of return results per function exceeded; max 3 but got 4
plugins/inputs/postgresql/service.go:145:20                          gosimple     S1007: should use raw string (`...`) with regexp.Compile to avoid having to escape twice
plugins/inputs/postgresql_extensible/postgresql_extensible.go:207:4  revive       defer: prefer not to defer inside loops
plugins/inputs/powerdns/powerdns.go:7:2                              revive       imports-blacklist: should not use the following blacklisted import: "log"
plugins/inputs/powerdns_recursor/powerdns_recursor.go:7:2            revive       imports-blacklist: should not use the following blacklisted import: "log"
plugins/inputs/procstat/process.go:46:2                              revive       import-shadowing: The name 'process' shadows an import name
plugins/inputs/procstat/procstat_test.go:54:3                        revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/procstat/procstat_test.go:59:2                        revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/inputs/prometheus/parser.go:109:49                           unconvert    unnecessary conversion
plugins/inputs/prometheus/parser.go:129:29                           unconvert    unnecessary conversion
plugins/inputs/prometheus/parser.go:133:31                           unconvert    unnecessary conversion
plugins/inputs/prometheus/parser.go:137:29                           unconvert    unnecessary conversion
plugins/inputs/prometheus/parser.go:66:28                            unconvert    unnecessary conversion
plugins/inputs/prometheus/parser.go:71:28                            unconvert    unnecessary conversion
plugins/inputs/prometheus/prometheus.go:184:35                       revive       empty-lines: extra empty line at the start of a block
plugins/inputs/prometheus/prometheus.go:256:3                        revive       unexported-naming: the symbol URL is local, its name should start with a lowercase letter
plugins/inputs/prometheus/prometheus.go:276:3                        revive       unexported-naming: the symbol URL is local, its name should start with a lowercase letter
plugins/inputs/prometheus/prometheus.go:404:26                       bodyclose    response body must be closed
plugins/inputs/prometheus/prometheus.go:406:25                       bodyclose    response body must be closed
plugins/inputs/proxmox/proxmox.go:239:1                              revive       function-result-limit: maximum number of return results per function exceeded; max 3 but got 4

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Nov 5, 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.

Just amazing @zak-pawel! One remark regarding the error handling in postgres-extensible...

@srebhan srebhan self-assigned this Nov 5, 2021
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Nov 6, 2021

⚠️ This pull request increases the Telegraf binary size by 1.11 % for linux amd64 (new size: 132.2 MB, nightly size 130.7 MB)

📦 Looks like new artifacts were built from this PR.

Expand this list to get them here! 🐯

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm freebsd_amd64.tar.gz windows_i386.zip
armel.deb armv6hl.rpm freebsd_armv7.tar.gz
armhf.deb i386.rpm freebsd_i386.tar.gz
i386.deb ppc64le.rpm linux_amd64.tar.gz
mips.deb s390x.rpm linux_arm64.tar.gz
mipsel.deb x86_64.rpm linux_armel.tar.gz
ppc64el.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_s390x.tar.gz
static_linux_amd64.tar.gz

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 @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 Nov 8, 2021
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Huge thank you for all of these changes.

I have a couple of questions about some logic-ish changes below before I +1 this.

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

If you can resolve the conflicts, we can merge.

@sspaink sspaink merged commit b9e4978 into influxdata:master Nov 15, 2021
@sspaink sspaink deleted the linter-fixes-inputs-p branch November 15, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug 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