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

disable-version-string not respected in packages config #785

Open
LandonTClipp opened this issue Jun 6, 2024 · 7 comments
Open

disable-version-string not respected in packages config #785

LandonTClipp opened this issue Jun 6, 2024 · 7 comments
Assignees
Labels
bug good-first-issue Good issue for beginners or first-time contributors to tackle

Comments

@LandonTClipp
Copy link
Collaborator

#783 (reply in thread)

@LandonTClipp LandonTClipp added bug good-first-issue Good issue for beginners or first-time contributors to tackle labels Jun 6, 2024
@Tochemey
Copy link

Tochemey commented Jun 6, 2024

@LandonTClipp I can take a look at this in the weekend if you don't mind. You can assign it to me.

@LandonTClipp
Copy link
Collaborator Author

That would be great! Thanks @Tochemey .

@Tochemey
Copy link

Tochemey commented Jun 8, 2024

@LandonTClipp I took a look at the code and I can see the prologue is always displayed. Something that is necessary. However disabling the version number seems be odd to me because I believe having to know which version of the tool is used is really important for migration or any update or bug fixes that will be needed by the developer.

I am of the opinion we should not even allow this flag to be there at all.

@Tochemey
Copy link

@LandonTClipp what is your take on this suggestion?

@LandonTClipp
Copy link
Collaborator Author

Hi @Tochemey , I think there is a legitimate use-case for developers. Often, projects will specify the exact version of mockery to use, and they will have a Makefile that does something like go run github.com/vektra/mockery which will pull down the specific version specified in go.mod. Some projects like to regularly update mockery, but doing so without disabling the version string can result in huge PRs that do not have any real changes. Some people just don't like that.

@BenjaminNolan
Copy link

If it'd help, I can pick this up, as it generates a lot of boilerplate PR lines for us.

diff --git a/mocks/db/Querier.go b/mocks/db/Querier.go
index e2a6681..8f75751 100644
--- a/mocks/db/Querier.go
+++ b/mocks/db/Querier.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.1. DO NOT EDIT.
+// Code generated by mockery v2.43.2. DO NOT EDIT.

 package mocks

diff --git a/mocks/db/DBTX.go b/mocks/db/DBTX.go
index f1b0504..404ac86 100644
--- a/mocks/db/DBTX.go
+++ b/mocks/db/DBTX.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.1. DO NOT EDIT.
+// Code generated by mockery v2.43.2. DO NOT EDIT.

 package mocks

diff --git a/mocks/db/Querier.go b/mocks/db/Querier.go
index fa5fe8c..d309ede 100644
--- a/mocks/db/Querier.go
+++ b/mocks/db/Querier.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.1. DO NOT EDIT.
+// Code generated by mockery v2.43.2. DO NOT EDIT.

 package mocks

diff --git a/mocks/registerServiceFunc.go b/mocks/registerServiceFunc.go
index 0ff27d1..f7820f2 100644
--- a/mocks/registerServiceFunc.go
+++ b/mocks/registerServiceFunc.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.1. DO NOT EDIT.
+// Code generated by mockery v2.43.2. DO NOT EDIT.

 package mocks

Just four out of about 3000 in our project. :)

I've actually added a line to our make mocks target which removes the version number, but it's really slow so getting the flag to work is preferable:

@mockery --all --keeptree --dir=./internal --output=./mocks
@for i in $$(grep -HlRE 'Code generated by mockery v[0-9]+\.[0-9]+\.[0-9]+\. DO NOT EDIT\.' mocks); do \
	sed -i'' -e 's/Code generated by mockery v[0-9]\+\.[0-9]\+\.[0-9]\+\. DO NOT EDIT\./Code generated by mockery. DO NOT EDIT./g' $$i; \
done

So, yeah, LMK if you want / need me to jump in. :)

@LandonTClipp
Copy link
Collaborator Author

Please do go for it, it should be a very simple change. I cannot sit down at a computer for the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good-first-issue Good issue for beginners or first-time contributors to tackle
Projects
None yet
Development

No branches or pull requests

3 participants