-
Notifications
You must be signed in to change notification settings - Fork 863
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
Update analyzer testing to Microsoft.CodeAnalysis.Testing #1272
Conversation
I'm uncomfortable adding a myget feed to our build dependency. Is that required? |
@normj Yes, this is one of the primary locations where Roslyn team publishes intermediate packages. They are still signed binaries, but don't fall under release API compat guarantees. There is no immediate plan to publish the testing library to NuGet, despite the fact that it already works very well. We are still making changes to the API as we find new cases that people want to test. |
Please feel free to ask questions about anything you see. I try to answer questions directly, from a "this is how we arrived at the current state" view, as opposed to trying to say whether something is right or wrong. The testing library was developed to help people write better tests that in turn lead to better analyzers and better code fixes. We're interested in any feedback related to that end-to-end story so the community can be successful. |
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
📝 The feed location changed; I can update this pull request to use the new one. |
All analyzers in this package report diagnostics in both user and generated code.
117086b
to
b9aa097
Compare
@normj This pull request now references code from nuget.org. |
@@ -36,32 +36,25 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.dll</HintPath> | |||
<Private>True</Private> | |||
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.1\lib\net45\Microsoft.CodeAnalysis.dll</HintPath> |
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 changes in this commit would be tremendously simplified for the future if the project transitions to <PackageReference>
for package references.
@@ -22,6 +23,8 @@ public Test() | |||
|
|||
return solution; | |||
}); | |||
|
|||
TestBehaviors |= TestBehaviors.SkipGeneratedCodeCheck; |
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 line can be removed if the analyzers update to Roslyn 1.2.1 and add a call to ConfigureGeneratedCodeAnalysis
.
@sharwell Good afternoon. I was reviewing outstanding PR(s) and came across this feature request. Please let me know if this PR is still relevant, or else confirm to close the same. Thanks, |
Hi @ashishdhingra , This change makes it easier to write tests for the analyzers in this project. Since it is a maintainability improvement and not an end-user product improvement, the relevance depends on the goals of the project. If the maintainers of this project intend to continue developing features in this repository, this change would still be relevant. Thanks, |
I'm closing this PR since we recently updated all of our analyzer projects to target We're now using a much more modern version of Please feel free to open a new issue if needed. |
Hi @dscpinheiro, It appears the changes you describe were reverted. Please feel free to reach out if you have questions about updating this code. Thanks, |
Hi @sharwell! Yes, we ended up reverting because my change to the We still want to update our analyzers to target Are there any concerns with this approach? We decided to revert the commit first (instead of only downgrading the package) as we weren't sure if that specific version could still break customers with older tooling (such as VS 2017 users prior to 15.9). |
Is there a specific motivating need to do this? Analyzers targeting netstandard1.3 (e.g. StyleCop Analyzers) will still execute within current versions of Visual Studio. The 2.10.0 release of Microsoft.CodeAnalysis.Common targets netstandard1.3. I'm not sure what the official support status is for a netstandard2.0 analyzer is when running inside Visual Studio 2017. Most users I know of have either dropped VS 2017 support, or maintained the analyzers targeting netstandard1.3. |
Description
Motivation and Context
This change makes it easier to comprehensively test analyzers.
Recommended review strategy: review each commit individually in sequence.
Testing
This is a test-only change.
Screenshots (if appropriate)
N/A
Types of changes
This is a test-only change; no observable impact on shipping code.
Checklist
License