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
Upgrade analyzers to .NET Standard 2.0 and test them on .NET Core #1667
Upgrade analyzers to .NET Standard 2.0 and test them on .NET Core #1667
Conversation
@@ -21,6 +21,8 @@ public override void Initialize(AnalysisContext context) | |||
throw new ArgumentNullException(nameof(context)); | |||
} | |||
|
|||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); | |||
context.EnableConcurrentExecution(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested by the "meta-analyzer"!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the meta-analyzer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I mean the "analyzer for writing analyzers". https://github.com/dotnet/roslyn-analyzers#microsoftcodeanalysisanalyzers
@@ -80,7 +80,7 @@ protected override void AnalyzeArgumentConstraintCore(string propertyFullName, S | |||
if (nonNullableParameterType is object && | |||
constraintType.IsValueType && | |||
!constraintType.IsNullable() && | |||
constraintType.Equals(nonNullableParameterType)) | |||
SymbolEqualityComparer.Default.Equals(constraintType, nonNullableParameterType)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the meta-analyzer
@@ -51,27 +51,32 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context) | |||
context.RegisterCodeFix( | |||
CodeAction.Create( | |||
MakeConstraintNullableCodeFixTitle, | |||
ct => MakeConstraintNullableAsync(context, diagnostic, ct)), | |||
ct => MakeConstraintNullableAsync(context, diagnostic, ct), | |||
equivalenceKey: "MakeConstraintNullable"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the meta-analyzer
diagnostic); | ||
} | ||
|
||
return CompletedTask; | ||
} | ||
|
||
public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to say it again?
and test them on .NET Core 2.1 and 3.0
c0fc4f4
to
e611973
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand things (which I mostly don't), looks great! Thanks, @thomaslevesque.
This change has been released as part of FakeItEasy 5.4.0. |
Cherry-picked the commits from my current work on #1662, I hope it didn't depend on anything I didn't include...