-
Notifications
You must be signed in to change notification settings - Fork 507
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
Added a new test project for c# 11 #3491
Added a new test project for c# 11 #3491
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3491 +/- ##
==========================================
- Coverage 93.25% 93.24% -0.01%
==========================================
Files 1066 1066
Lines 113311 113343 +32
Branches 3998 4002 +4
==========================================
+ Hits 105664 105690 +26
- Misses 6619 6623 +4
- Partials 1028 1030 +2 |
|
||
public class SA1600CSharp11UnitTests : SA1600CSharp10UnitTests | ||
{ | ||
protected override DiagnosticResult[] GetExpectedResultTestRegressionMethodGlobalNamespace(string 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.
❔ Is this different from the base class?
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.
I believe this override can be removed and the C# 11 test just use the one from C# 10
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.
👍
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis.CSharp; | ||
using StyleCop.Analyzers.Test.CSharp10.ReadabilityRules; | ||
using StyleCop.Analyzers.Test.Verifiers; | ||
using Xunit; | ||
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier< | ||
StyleCop.Analyzers.ReadabilityRules.SA1101PrefixLocalCallsWithThis, | ||
StyleCop.Analyzers.ReadabilityRules.SA1101CodeFixProvider>; |
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.
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.CodeAnalysis.CSharp; | |
using StyleCop.Analyzers.Test.CSharp10.ReadabilityRules; | |
using StyleCop.Analyzers.Test.Verifiers; | |
using Xunit; | |
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier< | |
StyleCop.Analyzers.ReadabilityRules.SA1101PrefixLocalCallsWithThis, | |
StyleCop.Analyzers.ReadabilityRules.SA1101CodeFixProvider>; | |
using StyleCop.Analyzers.Test.CSharp10.ReadabilityRules; |
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.
👍
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" /> |
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.
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" /> | |
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.2.0-2.final" /> |
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.
This would require an update of Microsoft.CodeAnalysis.Analyzers to version 3.3.3, which in turn would require some code fixes. Not much, but still. Ok?
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.
The fixes would be due to RS1034 (Prefer 'IsKind' for checking syntax kinds)
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.
That should be fine, especially if the update to 4.2.0-2.final occurs as its own commit.
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.
4.2.0-4.final arrived, so I used that one instead
📝 This change doesn't actually allow C# 11 features. You'll need updates to the following lines to use StyleCopAnalyzers/StyleCop.Analyzers/StyleCop.Analyzers.Test/Verifiers/StyleCopCodeFixVerifier`2.cs Line 115 in 528d635
Line 67 in 528d635
You'll want to use this default whenever StyleCopAnalyzers/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/LightupHelpers.cs Lines 46 to 47 in 528d635
|
…n the c# 11 test project
ee07495
to
6dc6195
Compare
Using a new version of Roslyn in the c# 11 tests also fixes #3492. |
Added test project for c# 11, to prepare for coming c# 11 tests.
(Copied c# 10 project, changed names and removed existing tests.)