kontent-ai / model-generator-net

Kontent.ai .NET model generator.
https://www.nuget.org/packages/Kontent.Ai.ModelGenerator
MIT License
17 stars 19 forks source link

Include // <auto-generated> at top of all generated files #141

Closed jrkd closed 2 years ago

jrkd commented 2 years ago

Motivation

We're attempting to use null reference checking and forcing null-reference checks to be compile errors, however generated files do not abide.

That would be fine, as warnings are usually ignored in generated files but the KontentModelGenerator currently does not mark them as autogenerated, and there is no option to enable such a feature.

Proposed solution

//--------------------------------------------------------------------------------------------------
// <auto-generated>
// "This file was generated by KontentModelGenerator v1.x.x etc"
// </auto-generated>
//--------------------------------------------------------------------------------------------------

Include this comment at the top of all generated files. This is something that already happens on Xperience for page types/custom tables etc.

jrkd commented 2 years ago

See mentioned PR #142 for a potential solution for this.

Sevitas commented 2 years ago

Hello @jrkd, thank you for submitting the issue. We will discuss the issue further. Once we have the result I will let you know.

Sevitas commented 2 years ago

Hi @jrkd, We have discussed the feature and it looks like a really great improvement, we would love to see in our product. I've left you some notes in the PR #142