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

Able to insert copyright file which already has comments into the header #142

Open
dmvolod opened this issue Jan 24, 2024 · 2 comments · May be fixed by #143
Open

Able to insert copyright file which already has comments into the header #142

dmvolod opened this issue Jan 24, 2024 · 2 comments · May be fixed by #143

Comments

@dmvolod
Copy link

dmvolod commented Jan 24, 2024

Requested feature A clear description of the desired feature and an example of
how it would be used.

A way to insert copyright file which already has comments inside into the header

Why the feature is needed A clear description of how this feature is not
served by existing functionality in gomock.

In some cases we may install copyright files that already contain comments defined as /*...*/ and we don't want to maintain separate files for separate code generation logic. In this case we need to implement logic to add plain text from the copyright file to the source code without start comment // on each line.

(Optional) Proposed solution A clear description of a proposed method for
adding this feature to gomock.

It would be nice to add separate -copyright_file_comments with default(false) value, which will allows to generate different comment lines with or without starting comment line.

@r-hang
Copy link
Contributor

r-hang commented Feb 20, 2024

Hey, thanks for filing this issue.

From my understanding of this ask, it's to enable a "raw copy" of content as the header since yours is already commented.

Since we already have an existing flag to add copyright content, I feel that adding a similar flag with very slightly different functionality would cause user confusion because there would now be multiple blessed ways to supply copyright headers to the generated code for a marginal benefit on a particular use case.

@dmvolod
Copy link
Author

dmvolod commented Feb 21, 2024

Thanks for feedback.

Yes, agree, that parameter -copyright_file_comments name a bit confusing and we can use another one, i.e. -copyright_file_raw or some other.
But this parameter is very desirable feature, as without it most of the Kubernetes oriented project will requires multiple header files or adds some hacks instead of single predefined option, for example

https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/blame/21eb53508daed2dc31990ee882f9f0b04ce15b03/internal/mocks/doc.go#L19-L22

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

Successfully merging a pull request may close this issue.

2 participants