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

Add assemblies and packages for new code style analyzer distribution #18285

Merged
merged 5 commits into from
Mar 31, 2017

Conversation

sharwell
Copy link
Member

@sharwell sharwell commented Mar 29, 2017

Fixes #18278.

New analyzer packages:

  • Microsoft.CodeAnalysis.CSharp.CodeStyle
  • Microsoft.CodeAnalysis.VisualBasic.CodeStyle

New projects containing code distributed with the above packages:

  • Microsoft.CodeAnalysis.CodeStyle (shared code for analyzers, no workspace reference)
  • Microsoft.CodeAnalysis.CodeStyle.Fixes (shared code for fixers)
  • Microsoft.CodeAnalysis.CSharp.CodeStyle (C# code style analyzers, no workspace reference)
  • Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (C# code style fixes)
  • Microsoft.CodeAnalysis.VisualBasic.CodeStyle (VB code style analyzers, no workspace reference)
  • Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (VB code style fixes)

New test projects:

  • Microsoft.CodeAnalysis.CodeStyle.UnitTests
  • Microsoft.CodeAnalysis.CodeStyle.CSharp.UnitTests
  • Microsoft.CodeAnalysis.CodeStyle.VisualBasic.UnitTests

Notes for specific reviewers:

@srivatsn: Please review the inclusion of install.ps1 and uninstall.ps1 in the new analyzer NuGet packages. Are these still necessary (or does NuGet automatically add references now), and if so, is this how you would include them?

@jaredpar I know you care about infrastructure, and also thanks for all the help leading up to this! 👏

@dpoeschl Is this enough of a foundation for us to work in parallel on the migration?

@Pilchie Please review the proposed NuGet package names and manner of distribution, etc.

@tmat Please review the change to BuildNuGets.csx.

Copy link
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

Overall structure / infra looks good!

<file src="$thirdPartyNoticesPath$" target="" />

<!-- Scripts -->
<file src="..\..\src\Setup\PowerShell\install.ps1" target="tools\" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes you need these if someone's installing the package to a packages.config-based project which is still the majority of projects out there.

Copy link
Member

@Pilchie Pilchie left a comment

Choose a reason for hiding this comment

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

👍 Overall, this looks good.

My big concern is about how we do this transition with incurring perf/dll load issues in the default VS cases.

One approach might be including files in these projects as links/extracting the code out to a shared project. Not sure if people have other ideas. Otherwise, we're looking at 2dll loads for each language, which I'm not sure we'll get approval for without winning them back somewhere else.

@@ -122,6 +124,8 @@ string[] TestPackageNames = {
var PreReleaseOnlyPackages = new HashSet<string>
{
"Microsoft.CodeAnalysis.Build.Tasks",
"Microsoft.CodeAnalysis.CSharp.CodeStyle",
"Microsoft.CodeAnalysis.VisualBasic.CodeStyle",
Copy link
Member

Choose a reason for hiding this comment

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

why are these pre-release only? When we ship a final release, we'll want to upload these?

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 literally took a guess and went with it, and then added @tmat as a required reviewer. 😆

Copy link
Member

Choose a reason for hiding this comment

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

As the comment above says, are we not going to publish these on nuget?


In reply to: 108894557 [](ancestors = 108894557)

Copy link
Member Author

@sharwell sharwell Mar 30, 2017

Choose a reason for hiding this comment

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

We are planning to publish these on NuGet. Does that mean I should remove them from PreReleaseOnlyPackages from the start (i.e. before they would actually be considered "ready for public release")?

Also, your comment only shows up in the Diff view for some reason. May I ask what client you used to create that comment?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

CodeFlow.


In reply to: 109054195 [](ancestors = 109054195)

</metadata>
<files>
<file src="Dlls\CSharpCodeStyle\Microsoft.CodeAnalysis.CSharp.CodeStyle.dll" target="analyzers\dotnet\cs" />
<file src="Dlls\CSharpCodeStyle\Microsoft.CodeAnalysis.CSharp.CodeStyle.xml" target="analyzers\dotnet\cs" />
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if it makes sense to distribute these for analyzers.

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 was thinking the same thing. I'm pretty sure the answer is we don't need them, so I'll go ahead and remove them now.

Copy link
Contributor

@dpoeschl dpoeschl left a comment

Choose a reason for hiding this comment

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

Looks like a great starting point. Thanks.

@sharwell
Copy link
Member Author

@Pilchie

My big concern is about how we do this transition with incurring perf/dll load issues in the default VS cases.

Oh, I'm worried about this too, but the big perf hit isn't going to be the DLL load. The switch from IDE- to NuGet-based analyzers will cause the code style analyzers to be regularly run against entire code bases, as opposed to only running them against files open in the IDE. I would not be surprised to find this leads to required perf work in both the code style analyzers themselves and the analyzer driver. On the bright side, improvements to the latter could lead to a big perf win for external analyzer projects which are already being shipped as NuGet packages.

@sharwell sharwell force-pushed the code-style-projects branch from 16d7b40 to f2ed1cc Compare March 30, 2017 17:52
@jaredpar
Copy link
Member

retest ubuntu_14_debug_prtest please

@sharwell sharwell force-pushed the code-style-projects branch from 45db511 to fadf696 Compare March 31, 2017 00:56
@sharwell sharwell added this to the 15.3 milestone Mar 31, 2017
@sharwell sharwell merged commit 940f119 into dotnet:master Mar 31, 2017
@sharwell sharwell deleted the code-style-projects branch March 31, 2017 03:13
@alrz
Copy link
Member

alrz commented Apr 3, 2017

@sharwell Is there any plan to move fxcop analyzers to these projects? e.g. #16621

https://github.com/dotnet/roslyn-analyzers/blob/569bd373a4831d3035597197e02980b57602a7f2/src/Microsoft.QualityGuidelines.Analyzers/Core/MarkMembersAsStatic.cs

I'm asking because I had a fix for this (#16902) and it's already implemented in roslyn-analyzers repo. I'm not clear if I'm going to implement an analyzer where exactly it should go.

@sharwell
Copy link
Member Author

sharwell commented Apr 3, 2017

@alrz It was not my original intent for the FxCop analyzers to move to these packages. The main short-term goal is to move several of the existing IDExxxx analyzers away from being IDE-specific to being able to run during command line builds (and thus on CI servers).

We're facing some big hurdles right now related to the fact that some of these analyzers use APIs that are only available while working in the IDE (mostly related to configurable options). I wanted to get the first step of creating these projects out of the way so the 50 changed files you see here don't interfere with our ability to review upcoming proposals related to exposing options to analyzer authors in a uniform way.

@ErikSchierboom
Copy link

@sharwell I have two questions, which you hopefully can answer:

  1. Are these new packages published on NuGet yet? I cannot seem to find them.
  2. Will these new packages work with .NET Core projects?

@jmarolf
Copy link
Contributor

jmarolf commented Apr 8, 2017

@ErikSchierboom

  1. they have not been published yet, but they should go on https://dotnet.myget.org/gallery/roslyn eventually
  2. They are netstandard1.3 so yes

@ErikSchierboom
Copy link

@jmarolf Okay, thanks for the response! Looking forward to them being released.

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.

Create new assemblies for NuGet-distributed analyzers
10 participants