datamodel-code-generator
datamodel-code-generator copied to clipboard
Auto-generated top-level text must include the `@generated` word (with `@` prepended).
Is your feature request related to a problem? Please describe.
Let's start with an example how other people use this. If you will take a look at https://github.com/koxudaxi/datamodel-code-generator/blob/master/poetry.lock#L1 you will see:
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
The @generated mark is described at https://generated.at/
Describe the solution you'd like
Prepend @ to the "generated" word.
Example:
# @generated by datamodel-codegen:
# filename: api.yaml
# timestamp: 2023-10-06T07:55:02+00:00
@AIGeneratedUsername
Thank you for suggesting the changes.
I wasn't familiar with the @generated tag.
Is it a standard in the generator world?
If someone has any thoughts on the advantages or disadvantages of adopting this, please feel free to share your opinions or vote.
It is widely used. However, not sure if we can call it a standard. https://generated.at/ tries to make it one. It is easier to recognize for tooling, though, compared to not adding the @ in front.
I was about to file a PR to suggest the same change.
A workaround so far is to use the following argument
--custom-file-header '# @generated by datamodel-codegen'
(Generally, I already use --disable-timestamp as it would cause issues with checks verifying that there are no missing generator changes otherwise.)