fix: Skip properties that have no getter method during scanning#2984
fix: Skip properties that have no getter method during scanning#2984timcassell merged 6 commits intodotnet:masterfrom
Conversation
|
@dotnet-policy-service agree |
|
Can you also add an analyzer rule for it? |
|
Sure. I haven't written analyzer rules before though, will take a look this weekend. |
|
Hi @timcassell, I just added the analyzer to capture this scenario. Sorry it took a bit of time. |
...rkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
|
Can you also add the new rule to the |
Done. btw, I checked the failures in CI - that's our new analyzer rule catching our new unit test code for that scenario. I'm not sure what needs to be done for these errors? |
Suppress it in source ( |
Fixes #2980.
When a property that's used as
ParamSourcehas no getter method (a write-only property),BenchmarkConverter.GetValidValuesForParamsSource()throwsNullReferenceException. This PR makes it skip such write-only property since they can't be used as the param source, this will result in anInvalidBenchmarkDeclarationExceptionwhich is clearer.