Skip to content

Port DisposeAnalyzers to release/dev16.2-preview2#36112

Merged
mavasani merged 8 commits intodotnet:release/dev16.2-preview2from
mavasani:PortDisposeAnalyzers_Dev162Preview2
Jun 2, 2019
Merged

Port DisposeAnalyzers to release/dev16.2-preview2#36112
mavasani merged 8 commits intodotnet:release/dev16.2-preview2from
mavasani:PortDisposeAnalyzers_Dev162Preview2

Conversation

@mavasani
Copy link
Copy Markdown
Contributor

@mavasani mavasani commented Jun 1, 2019

mavasani added 8 commits June 1, 2019 06:35
(DisposableFieldsShouldBeDisposed)

We will now flag disposable creations in methods that do not escape the
method body (return value, out/ref params, assign to field/property, add
to collection, etc.). Additionally, we also flag disposable fields of
disposable types that are not disposed in the type's Dispose method.
Ported analyzers share the core dataflow analysis computation with the
analyzers in the roslyn-analyzers repo
(Microsoft.CodeAnalysis.FlowAnalysis.Utilities). This PR does not add
any code fixes. We already have a code
refactoring that offers wrapping a disposable creation within a using
statement. I am hoping to extend that to handle more cases and also
possibly convert it to a code fix in follow-up PR(s).
… assembly load lazy and revert reference add to the FlowAnalysis assembly in Workspaces (only referenced in Features now).
Additionally, we do not mark the package reference to in Features.csproj as PrivateAsset as this leads to the assembly not getting included in the Features NuGet package and causes Omnisharp's analyzer execution to throw missing dependency assembly load errors.
Also update ExpectedDependency in DevDivInsertionFiles.csproj
@mavasani mavasani requested a review from jinujoseph June 1, 2019 15:43
@mavasani mavasani requested review from a team as code owners June 1, 2019 15:43
@jinujoseph jinujoseph added this to the 16.2.P2 milestone Jun 2, 2019
@mavasani mavasani merged commit c6b8c34 into dotnet:release/dev16.2-preview2 Jun 2, 2019
@mavasani mavasani deleted the PortDisposeAnalyzers_Dev162Preview2 branch June 2, 2019 08:29
agocke added a commit to agocke/roslyn that referenced this pull request Jun 21, 2019
agocke added a commit that referenced this pull request Jun 24, 2019
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