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 handling of line endings in FileHeaderCodeFixProvider + SA1635 code fix #1440

Merged
merged 3 commits into from
Sep 10, 2015

Conversation

sharwell
Copy link
Member


var expectedDiagnostic = this.CSharpDiagnostic(FileHeaderAnalyzers.SA1633DescriptorMissing).WithLocation(1, 1);
await this.VerifyCSharpDiagnosticAsync(testCode, expectedDiagnostic, CancellationToken.None).ConfigureAwait(false);
await this.VerifyCSharpDiagnosticAsync(fixedCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await this.VerifyCSharpFixAsync(testCode, fixedCode, cancellationToken: CancellationToken.None).ConfigureAwait(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing a CancellationToken.None to VerifyCSharpFixAsync is unnecessary and it does not help readability.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pass a cancellation token in all cases where one can be passed. I would greatly prefer to pass one as described in xunit/xunit#345 but that option is not currently available.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.
❓ Given that policy, would it be a good idea to modify syntax of VerifyCSharpFixAsync to require a cancellation token as its 3rd parameter? That would improve readability and it would also force consistency over the codebase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather let this be motivation for DotNetAnalyzers/AsyncUsageAnalyzers#36 and DotNetAnalyzers/AsyncUsageAnalyzers#37, and correct any violations when those are available.

sharwell added a commit that referenced this pull request Sep 10, 2015
Fix handling of line endings in FileHeaderCodeFixProvider + SA1635 code fix
@sharwell sharwell merged commit 988ef21 into DotNetAnalyzers:master Sep 10, 2015
@sharwell sharwell deleted the fix-1437 branch September 10, 2015 23:35
@sharwell sharwell added the fixed label Sep 10, 2015
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.

2 participants