nunavut
nunavut copied to clipboard
Put .gitignore into generated root namespace directories automatically
I suggest that we provide an option that, when enabled, creates .gitignore
(and possibly other VCS ignore files) inside every root namespace directory. The ignore file should contain a single *
to ignore all generated files. Maybe this should be the default behavior.
I'm dubious. This seems like something an IDE or build system to do.
The build system -- sure; not sure about IDE (it shouldn't be involved in code generation, normally). But what about Python. Suppose you have a script that generates Python packages from DSDL namespaces and stores the results in-tree. This appears to be a common use case. I would like the generated files to be automatically excluded from version control. I could easily add the required behavior to PyUAVCAN:
for p in pyuavcan.dsdl.compile_all([...]):
(p.path / ".gitignore").write_text("*")
but then https://github.com/UAVCAN/pyuavcan/issues/110 would probably require this to be migrated to Nunavut, so it might be sensible to unify it across all target languages.