aurzenligl / prophy

prophy: fast serialization protocol
MIT License
13 stars 8 forks source link

Add comment in generated codec that its generated #22

Open D0han opened 5 years ago

D0han commented 5 years ago

Add comment in generated codec that its generated, so they can be easily distinguished from actual code in workspace.

kamichal commented 5 years ago

Sure, no problem, will do in next release, but there are no codecs that are not generated. I mean each file containing a codec is generated "by machine" and if user adds these files to some project or VCS so that it mixes up with "hand-written" code, then it's assumed that the user can distinguish it.

florczakraf commented 5 years ago

but there are no codecs that are not generated

Why? What if I just want to define some interface in python and don't want any other bindings? I don't need it to be generated from any other schema language in that case.


I can also see how such comment could help to debug some cases if it included prophy's and libclang versions.

kamichal commented 5 years ago

@florczakraf Yes, your're right. Version 1.2.0 already implements adding # This file has been generated by prophyc. sentence at the beginning of each python codec file. We can add also prophyc version from prophyc/__init__.py, but I would rather refuse adding libclang's version. It makes sense only for codecs generated with use of clang, but python codec can be generated from other sources as well.