Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Mar 26, 2024

Conversation

dupdob
Copy link
Member

@dupdob dupdob commented Mar 23, 2024

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.

@dupdob dupdob force-pushed the razor_quick_workaround branch from 64cf618 to 7e4254d Compare March 23, 2024 10:54
@dupdob dupdob changed the title Add ability to ignore some code generator errors Forward build options to code analyzers and generators Mar 24, 2024
@rouke-broersma rouke-broersma changed the title Forward build options to code analyzers and generators fix: Forward build options to code analyzers and generators Mar 26, 2024
@rouke-broersma rouke-broersma enabled auto-merge (squash) March 26, 2024 08:37
Copy link

sonarcloud bot commented Mar 26, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

@rouke-broersma rouke-broersma merged commit d93b08c into master Mar 26, 2024
8 of 9 checks passed
@rouke-broersma rouke-broersma deleted the razor_quick_workaround branch March 26, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants