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

Move forward the version of analyzer packages generated and dogfooded in the repo #3423

Merged
merged 5 commits into from
Mar 24, 2020

Conversation

mavasani
Copy link
Contributor

Recommended to review commit by commit

@mavasani mavasani requested a review from a team as a code owner March 24, 2020 19:06
VERSIONING.md Outdated Show resolved Hide resolved
@@ -178,7 +178,9 @@ private ImmutableHashSet<INamedTypeSymbol> GetUsedNamedTypes(INamedTypeSymbol na
// GetSyntax for VB returns the StatementSyntax instead of BlockSyntax node.
syntax = syntax.FirstAncestorOrSelf<SyntaxNode>(node => IsNamedTypeDeclarationBlock(node), ascendOutOfTrivia: false) ?? syntax;

#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will file an issue to consider rewriting this analyzer to avoid this suppression.

@@ -121,7 +121,7 @@ private static void AnalyzeOperation(OperationAnalysisContext context, Func<Synt

private static bool IsCompilerGeneratedParamsArray(IArrayCreationOperation arrayCreationExpression, OperationAnalysisContext context)
{
var model = context.Compilation.GetSemanticModel(arrayCreationExpression.Syntax.SyntaxTree);
var model = arrayCreationExpression.SemanticModel;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Evangelink - thanks for your analyzer!

@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #3423 into master will not change coverage by %.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3423   +/-   ##
=======================================
  Coverage   95.26%   95.26%           
=======================================
  Files         997      997           
  Lines      228557   228557           
  Branches    14684    14686    +2     
=======================================
  Hits       217724   217724           
  Misses       9200     9200           
  Partials     1633     1633           

@@ -5,7 +5,7 @@ Rule ID | Title | Category | Enabled | Severity | CodeFix | Description |
[CA1001](https://docs.microsoft.com/visualstudio/code-quality/ca1001) | Types that own disposable fields should be disposable | Design | True | Warning | True | A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface. |
[CA1003](https://docs.microsoft.com/visualstudio/code-quality/ca1003) | Use generic event handler instances | Design | False | Warning | False | A type contains an event that declares an EventHandler delegate that returns void, whose signature contains two parameters (the first an object and the second a type that is assignable to EventArgs), and the containing assembly targets Microsoft .NET Framework?2.0. |
[CA1008](https://docs.microsoft.com/visualstudio/code-quality/ca1008) | Enums should have zero value | Design | False | Warning | True | The default value of an uninitialized enumeration, just as other value types, is zero. A nonflags-attributed enumeration should define a member by using the value of zero so that the default value is a valid value of the enumeration. If an enumeration that has the FlagsAttribute attribute applied defines a zero-valued member, its name should be ""None"" to indicate that no values have been set in the enumeration. |
[CA1010](https://docs.microsoft.com/visualstudio/code-quality/ca1010) | Collections should implement generic interface | Design | True | Warning | False | To broaden the usability of a collection, implement one of the generic collection interfaces. Then the collection can be used to populate generic collection types. |
[CA1010](https://docs.microsoft.com/visualstudio/code-quality/ca1010) | Generic interface should also be implemented | Design | True | Warning | False | To broaden the usability of a type, implement one of the generic interfaces. This is especially true for collections as they can then be used to populate generic collection types. |
Copy link
Member

Choose a reason for hiding this comment

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

Is it a manual change? If so it might be nice to have a script at least to check, at best to fail the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is through a tool that runs when we build NuGet packages.

@@ -89,7 +89,9 @@ private static void AnalyzeField(SymbolAnalysisContext originalContext, IFieldSy
return;
}

#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer
Copy link
Member

Choose a reason for hiding this comment

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

Is it too complex to change now or do you prefer to handle this in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this applies to all symbol based analyzers.

Copy link
Contributor

@dotpaul dotpaul left a comment

Choose a reason for hiding this comment

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

🚢

@mavasani
Copy link
Contributor Author

Thank you @dotpaul!

@mavasani mavasani merged commit f902405 into dotnet:master Mar 24, 2020
@mavasani mavasani deleted the RepoForward branch March 24, 2020 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants