@generated
markerSometimes we store generated files in source folders. For example, Java sources generated with Protocol Buffers can be committed to the repository for convenience. Another example is Cargo.lock
or yarn.lock
files which contain resolved versions of dependencies.
There is a variety of tools which work with files:
These tools need to handle generated files differently, for example:
Let's invent a standard how to mark files generated.
We did not find any common conventions, so we picked
@generated
marker. Place it anywhere in the beginning of the file, and the file is considered generated:
# This file is @generated by ./gen.sh.
# Do not edit.
@generated
@generated
marker internally@generated
opt-in@generated
as well@generated
Cargo.lock
files with @generated
marker@generated
tag (which is accidentally compatible with @generated
marker)@generated
marker@generated
?Or have something else to say? Send us a message to generated.at@gmail.com.