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

Upgrade analyzers to .NET Standard 2.0 and test them on .NET Core #1667

Merged
merged 2 commits into from Oct 21, 2019

Conversation

thomaslevesque
Copy link
Member

Cherry-picked the commits from my current work on #1662, I hope it didn't depend on anything I didn't include...

@@ -21,6 +21,8 @@ public override void Initialize(AnalysisContext context)
throw new ArgumentNullException(nameof(context));
}

context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
context.EnableConcurrentExecution();
Copy link
Member Author

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"!

Copy link
Member

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?

Copy link
Member Author

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))
Copy link
Member Author

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"),
Copy link
Member Author

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;
Copy link
Member Author

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?

Copy link
Member

@blairconrad blairconrad left a 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.

@blairconrad blairconrad merged commit a0525b7 into FakeItEasy:master Oct 21, 2019
@blairconrad blairconrad added this to the vNext milestone Oct 21, 2019
@thomaslevesque thomaslevesque deleted the upgrade-analyzers branch October 21, 2019 08:05
@thomaslevesque
Copy link
Member Author

This change has been released as part of FakeItEasy 5.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants