MelGrubb / BuilderGenerator

A source-generator-based implementation of the Builder pattern
https://melgrubb.github.io/BuilderGenerator/
MIT License
38 stars 8 forks source link

StyleCop and compiler warnings #12

Closed stuartwhiteford closed 2 years ago

stuartwhiteford commented 2 years ago

Hi,

Would it be possible to adjust the generated code to have StyleCop ignore the generated files?

Something like...

// <auto-generated/>
#pragma warning disable

and

#pragma warning restore

Happy to submit a PR with the changes...? Cheers, Stuart.

MelGrubb commented 2 years ago

Since the filenames already include "generated", I would have thought that StyleCop was supposed to be ignoring them already. Interesting. I don't think I'd want to turn off all the warnings, but I also can't predict what your StyleCop configuration will look like, so maybe this is the only option. I'm still wondering why it's complaining about a generated file in the first place though.

MelGrubb commented 2 years ago

I'm hopefully back to active development here soon. If you beat me to it I'm happy to take a PR though.

MelGrubb commented 2 years ago

The generated files now have an "// " header. I don't see a way to use pragmas to disable ALL warnings. I could be looking in the wrong place, of course, but what I'm seeing says you can't do that.