stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.75k stars 176 forks source link

fix: Forward build options to code analyzers and generators #2891

Closed dupdob closed 3 months ago

dupdob commented 3 months ago

Stryker can now ignore some error reported by code generators. It may still fail when code generators are actually needed, but project not using those will no longer be affected. Fix #2881.

May also fix #2736, #2776, #2797 and #1486

Note: a proper fix requires to find an instance of AnalyzerConfigOptionsProvider or implement one, which seems non trivial in the general sense. But a basic implementation returning values from IAnalyzerResult properties may be sufficient for some or most use cases.

It turns out that implementing the basic version of an AnalyzerConfigOptionsProvider was straightforward and it fixes this issue. It should also help with sourcegenerator in general. Note that they are additional features to the AnalyzerConfigOptionsProvider that are harder to implement, such as supporting per source files options. But it looks that the C# compiler does not use these which could be dedicated to IDE.

sonarcloud[bot] commented 3 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
75.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud