lint: update golangci-lint to v1.45.2 - #3502
Conversation
thaJeztah
commented
Mar 27, 2022
- relates to update go to 1.18.0 #3501
Codecov Report
@@ Coverage Diff @@
## master #3502 +/- ##
==========================================
+ Coverage 58.63% 59.01% +0.38%
==========================================
Files 282 284 +2
Lines 23826 23834 +8
==========================================
+ Hits 13970 14066 +96
+ Misses 8998 8909 -89
- Partials 858 859 +1 |
d2986e6 to
92f1c97
Compare
| tmpl, err := templates.Parse(c.finalFormat) | ||
| if err != nil { | ||
| return tmpl, errors.Errorf("Template parsing error: %v\n", err) | ||
| return tmpl, errors.Wrap(err, "template parsing error") |
There was a problem hiding this comment.
FWIW; although the error changed (removing the newline at the end); when printed on the command-line, there's still a newline printed, so not sure why this was added in the first place 🤷♂️
1790ec3 to
7204b7a
Compare
|
whoop, green now; @silvin-lubecki @crazy-max PTAL |
| if c.os == winOSType { | ||
| return units.BytesSize(c.s.Memory) | ||
| } | ||
| return fmt.Sprintf("%s / %s", units.BytesSize(c.s.Memory), units.BytesSize(c.s.MemoryLimit)) |
There was a problem hiding this comment.
Nit: I'm not really enthousiast with this modification, even if I understand why. I think the sprintf version is easier to read and review. Anyway it's just nitpicking here.
There was a problem hiding this comment.
Let me do those separate, as they're not strictly needed for the linter, but given that this stats output is called in a loop (to refresh stats), I thought it would be worth to change them. Looking at the file, I now see some other ones that could be adjusted in that respect, so let me change these back and do it separately.
There was a problem hiding this comment.
oh! of course it helps if I ping you after that; updated 👍 PTAL
cli/command/container/formatter_stats.go:184:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("--")
^
cli/command/container/formatter_stats.go:191:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("-- / --")
^
cli/command/container/formatter_stats.go:201:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("--")
^
cli/command/container/formatter_stats.go:184:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("--")
^
cli/command/container/formatter_stats.go:191:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("-- / --")
^
cli/command/container/formatter_stats.go:201:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("--")
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
cli/config/credentials/native_store.go:10:2: G101: Potential hardcoded credentials (gosec)
remoteCredentialsPrefix = "docker-credential-"
^
cli/command/service/opts.go:917:2: G101: Potential hardcoded credentials (gosec)
flagCredentialSpec = "credential-spec"
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
cli/compose/interpolation/interpolation.go:102:4: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
"invalid interpolation format for %s: %#v. You may need to escape any $ with another $.",
^
cli/command/stack/loader/loader.go:30:30: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
return nil, errors.Errorf("Compose file contains unsupported options:\n\n%s\n",
^
cli/command/formatter/formatter.go:76:30: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
return tmpl, errors.Errorf("Template parsing error: %v\n", err)
^
cli/command/formatter/formatter.go:97:24: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
return errors.Errorf("Template parsing error: %v\n", err)
^
cli/command/image/build.go:257:25: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
return errors.Errorf("error checking context: '%s'.", err)
^
cli/command/volume/create.go:35:27: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
return errors.Errorf("Conflicting options: either specify --name or provide positional arg, not both\n")
^
cli/command/container/create.go:160:24: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
return errors.Errorf("failed to remove the CID file '%s': %s \n", cid.path, err)
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also removed deprecated linters: The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
7204b7a to
3ffe6a3
Compare