image: enable gofumpt formatter#457
Conversation
common and storage already use gofumpt. enable it for image based on the outcome from our community discussion[1]. And it makes this repo use the same formatter consistently which is nice. [1] podman-container-tools/podman#27291 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
|
✅ A new PR has been created in buildah to vendor these changes: podman-container-tools/buildah#6493 |
mtrmac
left a comment
There was a problem hiding this comment.
Thanks!
(Note to self: I didn’t review all the changes, hopefully that can be verified by re-formatting and comparing.)
| if sys != nil && sys.DockerDaemonHost != client.DefaultDockerHost { | ||
| mustMatchRuntimeOS = false | ||
| } | ||
| mustMatchRuntimeOS := sys != nil && sys.DockerDaemonHost != client.DefaultDockerHost |
There was a problem hiding this comment.
ah, yes I just copy pasted without thinking about it to much but true/false is inverted here
There was a problem hiding this comment.
switched to sys == nil || sys.DockerDaemonHost == client.DefaultDockerHost which I think is the right logic?
There was a problem hiding this comment.
Yes. (It wouldn’t be too bad to do
connectsToDifferentHost := sys != nil && sys.DockerDaemonHost != client.DefaultDockerHost
mustMatchRuntimeOS := !connectsToDifferentHostto self-document what the decision is about.)
This was uncovered by the gofumpt changes it seems. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Add simple fmt target to run golangci-lint fmt to format the source tree. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
mtrmac
left a comment
There was a problem hiding this comment.
LGTM, let’s get this in quickly, this would be a pain to rebase.
Thanks!
common and storage already use gofumpt. enable it for image based on the
outcome from our community discussion[1]. And it makes this repo use the
same formatter consistently which is nice.
[1] podman-container-tools/podman#27291