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

Option to disable output of version number in generated files header #399

Closed
danielr opened this issue Aug 22, 2017 · 9 comments
Closed
Milestone

Comments

@danielr
Copy link
Contributor

danielr commented Aug 22, 2017

For those people who like committing the generated files to version control (yes, I'm aware of the pros and cons), it would be great to have the option to exclude the version number from the header of the generated files. Otherwise every upgrade of Sourcery leads to meaningless changes in the working copy:

-// Generated using Sourcery 0.7.2 — https://github.com/krzysztofzablocki/Sourcery
+// Generated using Sourcery 0.8.0 — https://github.com/krzysztofzablocki/Sourcery

I guess this could be either a command line option, or an option in the config file (or both).

I'd be happy to contribute this myself in case it's deemed useful.

@Antondomashnev
Copy link
Collaborator

Hi @danielr I see your point, but from my perspective the version is something that may help eventually, as a reference I see that CocoaPods, for example, also writes version that generated Podfile.lock.

@ilyapuchka @krzysztofzablocki what do you think about it?

@krzysztofzablocki
Copy link
Owner

I agree with @Antondomashnev, its helpful to have version there

@Antondomashnev
Copy link
Collaborator

@danielr I think we should keep the version number, and I really think it may help your team eventually 😄

@ilyapuchka
Copy link
Collaborator

Agree too, having version is valuable.

@dcacenabes
Copy link
Contributor

Hi!
I know this ticket has been closed for many years now, but we're currently struggling with this. We use a cache mechanism to re-use precompiled versions of our modules. The tool computes a SHA based on the contents of the source files within a module. Since Sourcery includes the version in the autogenerated files, it causes the SHA to be different triggering a cache miss.

I understand that versioning can be of use to some people. Is there any chance you reconsider adding an option to make this configurable?

@art-divin
Copy link
Collaborator

Hello @dcacenabes ,

due to the importance of speeding up CI time and improving developer experience, which was rarely the case in the past,
I agree that we really should disable this part of the header from the generated files. It does not serve purpose these days anyways, as far as for the last year there was not a single bug fix, where this information helped in its resolution.

Let's reopen and quickly fix 👍🏻

@art-divin art-divin reopened this Mar 25, 2024
@art-divin art-divin added this to the 2.1.9 milestone Mar 25, 2024
@dcacenabes
Copy link
Contributor

Hey @art-divin, if you want to go for removing it, I can contribute with a PR myself if it is ok with you :)

@art-divin
Copy link
Collaborator

Hey 👋

Would be greatly appreciated, in fact, just in time before 2.1.9 release!

@dcacenabes
Copy link
Contributor

I just opened a PR, but I am not sure if I should have edited all the .generated files. Since they were being tracked under source control I decided to update them too.
#1309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants