Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Run gofmt first after generating code #236

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

BenTheElder
Copy link
Contributor

generating code before gofmt causes make tidy to create spurious diffs with leading blank lines in generated code. moving gofmt to run after generating code avoids this.

@BenTheElder
Copy link
Contributor Author

without this change a make tidy on HEAD with no changes creates the following diff:

diff --git a/pkg/client/zz_generated.client_image.go b/pkg/client/zz_generated.client_image.go
index 99f8806..6e679e7 100644
--- a/pkg/client/zz_generated.client_image.go
+++ b/pkg/client/zz_generated.client_image.go
@@ -1,3 +1,4 @@
+
 /*
        Note: This file is autogenerated! Do not edit it manually!
        Edit client_image_template.go instead, and run
diff --git a/pkg/client/zz_generated.client_kernel.go b/pkg/client/zz_generated.client_kernel.go
index f1919cd..76fd4b4 100644
--- a/pkg/client/zz_generated.client_kernel.go
+++ b/pkg/client/zz_generated.client_kernel.go
@@ -1,3 +1,4 @@
+
 /*
        Note: This file is autogenerated! Do not edit it manually!
        Edit client_kernel_template.go instead, and run
diff --git a/pkg/client/zz_generated.client_vm.go b/pkg/client/zz_generated.client_vm.go
index a657220..40cd956 100644
--- a/pkg/client/zz_generated.client_vm.go
+++ b/pkg/client/zz_generated.client_vm.go
@@ -1,3 +1,4 @@
+
 /*
        Note: This file is autogenerated! Do not edit it manually!
        Edit client_vm_template.go instead, and run

@luxas luxas added this to the v0.5.0 milestone Jul 29, 2019
@luxas luxas self-assigned this Jul 29, 2019
Copy link
Contributor

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Thanks! Yeah, I remember seeing this randomly some time before, but not knowing why it happened 😂

@luxas luxas merged commit 410cff7 into weaveworks:master Jul 29, 2019
@BenTheElder BenTheElder deleted the format-after-generate branch July 29, 2019 14:38
@luxas luxas added the kind/bug Categorizes issue or PR as related to a bug. label Aug 6, 2019
@luxas luxas changed the title gofmt after generating code Run gofmt first after generating code Aug 6, 2019
@luxas luxas changed the title Run gofmt first after generating code Run gofmt first after generating code Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants