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

Add option to allow for a generated code comment #531

Closed
adayNU opened this issue Mar 9, 2022 · 5 comments · Fixed by #1037
Closed

Add option to allow for a generated code comment #531

adayNU opened this issue Mar 9, 2022 · 5 comments · Fixed by #1037

Comments

@adayNU
Copy link

adayNU commented Mar 9, 2022

We'd like for GH / Reviewable to understand these files are generated. Would you be open to adding a flag like: --ts_proto_opt=header=true

Which would prepend something like // Code generated by protoc-gen-ts. DO NOT EDIT. to the first line of every file.

If this seems reasonable, I'd be happy to implement.

@stephenh
Copy link
Owner

@adayNU yep, that sounds like a good idea; a PR would be great!

@boukeversteegh
Copy link
Collaborator

It could even be there by default. It's a comment so it will be stripped in most cases by webpack anyway.

@stephenh
Copy link
Owner

stephenh commented May 2, 2022

Yep, good point / +1 to a hard-coded value. We could someday have like a prefixFile=./my-custom-prefix.txt opt to override it, but I assume for now we could drop basically any known string into prefixDisableLinter and be good enough.

@dasco144
Copy link
Contributor

I think this might be a nice feature to add. We could include additional information, like how the protoc-gen-go plugin does

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.29.0
// 	protoc        v4.22.2
// source: foo.proto

@stephenh
Copy link
Owner

stephenh commented May 1, 2024

Better late than never :-) thank you @dasco144 ! 🎉

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.

4 participants