Disable code analysis for generated code#10337
Conversation
|
Even when we have enabled MilCodeGen, we would still need to keep some rules disabled for the generated code right ? Like the rule for unnecessary imports, is something that needs to be disabled in that case. /cc @harshit7962 |
|
The typical behavior of code analyzers is to ignore generated files, code analysis uses a specifc pattern to detect generated files and the files generated by MilCodeGen does not match that pattern. This PR makes it so that code analysis knows that MilCodeGen files are generated. Personally I don't see much value in enabling code analysis for generated files. Generated code will probably never be perfect and IMO it should be done manually (By removing the line I added locally and manually checking the warnings). |
harshit7962
left a comment
There was a problem hiding this comment.
LGTM, as suggested we can take care of styling in generated code later.
|
Thank you for the contribution @ThomasGoulet73. |
|
Thanks @harshit7962 |
Description
Disables code analysis for generated code. Code analysis for generated code does not make sense since generated code will never be perfectly formatted and it prevents doing auto formatting to generated code without modifying the code generator.
We'll probably want to format the generated code someday but it should probably be done only when #6135 is merged and we can modify the code generator instead of modifying the generated code manually.
Customer Impact
None.
Regression
No.
Testing
Local build + CI.
Risk
None.
Microsoft Reviewers: Open in CodeFlow