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
Forward CancellationToken analyzer and code fixer #5923
Conversation
91a923c
to
98222ca
Compare
98222ca
to
92fb726
Compare
92fb726
to
c753050
Compare
c753050
to
40301d7
Compare
40301d7
to
29ab3e5
Compare
29ab3e5
to
1c2d1bf
Compare
086df8c
to
80dbd6e
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It's alive, Jim. |
7ea6099
to
7aed0fb
Compare
….0 and netstandard1.3
3f52132
to
4b35767
Compare
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(diagnostic); | ||
|
||
public override void Initialize(AnalysisContext context) => context.RegisterSyntaxNodeAction(Analyze, SyntaxKind.InvocationExpression); | ||
public override void Initialize(AnalysisContext context) => | ||
context.WithDefaultSettings().RegisterSyntaxNodeAction(Analyze, SyntaxKind.InvocationExpression); |
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.
By calling WithDefaultSettings
here, we are changing the behaviour of the existing analyzer, to ignore generated code. Is that desirable?
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.
First thought: You don't fix generated code you fix the generator.
Second thought: It is a major.
I'm not sure we ever intended to analyze generated code.
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.
But if generated code is ignored, how do you find out that the generator needs to be fixed?
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.
Based on this article and the high bar usages in the Roslyn Analyzers repo have documented for non-None use I'm going to leave it as is for now.
src/NServiceBus.Core.Analyzer/ForwardCancellationTokenAnalyzer.cs
Outdated
Show resolved
Hide resolved
Regarding the build failure — #6051 (comment) |
Converting to draft until we've decided how to proceed here. |
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.
From my POV, https://github.com/Particular/NServiceBus/pull/5923/files#r625785627 is the only outstanding thread here.
Replaces #5867
WIP until #5897 is merged