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

Be able to add a header to all files generated #24

Closed
markmandel opened this issue Jun 25, 2024 · 1 comment · Fixed by #27
Closed

Be able to add a header to all files generated #24

markmandel opened this issue Jun 25, 2024 · 1 comment · Fixed by #27
Assignees
Labels
enhancement New feature or request

Comments

@markmandel
Copy link

Is your feature request related to a problem? Please describe.

My use case is being able to apply an Apache 2 header to all generated files in an open source project - as well as being able to specify in a top level header that the file is generated and shouldn't be edited by hand.

Describe the solution you'd like

I'd love a --prepend-header-file option (or similar) to the project which I can point to a file that contains any header content I want to add to all files that are generated.

Describe alternatives you've considered

I could do this after the fact in my own scripting - but I expect proto-gen validate will then fail, as if I add the header the source will be different from what is generated.

Additional context

Generated code in https://github.com/googleforgames/quilkin/tree/main/crates/quilkin-proto/src should all have apache headers.

@bwestlin
Copy link
Member

This is now added and released in 0.2.10 where now --prepend-header-file can be passed for a file to be prepended in all the generated files.

Additionally the option -p or --prepend-header can be passed to include the followoing in each file, which also acts as a marker of which version that was used:

// Generated with https://github.com/EmbarkStudios/proto-gen v.0.2.10

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

Successfully merging a pull request may close this issue.

2 participants