Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Update analyzer versions (#42249)
Browse files Browse the repository at this point in the history
* Update analyzer packages to latest NuGet versions

* Fix new warnings
  • Loading branch information
stephentoub authored and safern committed Oct 31, 2019
1 parent 54efc11 commit 51686cb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions eng/analyzers.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.3.0-beta2-final" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Common/src/CoreLib/CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<Rule Id="CA5369" Action="None" /> <!-- Use XmlReader For Deserialize -->
<Rule Id="CA5371" Action="None" /> <!-- Use XmlReader For Schema Read -->
<Rule Id="CA5372" Action="None" /> <!-- Use XmlReader For XPathDocument -->
<Rule Id="CA5397" Action="None" /> <!-- Security protocol version is deprecated -->
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="AD0001" Action="None" /> <!-- Analyzer threw an exception -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static ConstructorInfo AddToModule(ModuleBuilder mb)
// Find the ctor that takes only AttributeTargets
ConstructorInfo attributeUsageConstructorInfo =
attributeUsageTypeInfo.DeclaredConstructors
.Single(c => c.GetParameters().Count() == 1 &&
.Single(c => c.GetParameters().Length == 1 &&
c.GetParameters()[0].ParameterType == typeof(AttributeTargets));

// Find the property to set AllowMultiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

Expand Down Expand Up @@ -116,7 +115,7 @@ private void ParseSelectConstructor(Expression<Func<ParameterImportBuilder, T>>
if (argument.NodeType == ExpressionType.Call)
{
var methodCallExpression = (MethodCallExpression)argument;
if (methodCallExpression.Arguments.Count() == 1)
if (methodCallExpression.Arguments.Count == 1)
{
Expression parameter = methodCallExpression.Arguments[0];
if (parameter.NodeType == ExpressionType.Lambda)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Linq.Expressions;
using System.Reflection;

namespace System.Composition.Convention
{
Expand Down Expand Up @@ -182,7 +181,7 @@ private void ParseSelectConstructor(Expression<Func<ParameterImportConventionBui
if (argument.NodeType == ExpressionType.Call)
{
var methodCallExpression = (MethodCallExpression)argument;
if (methodCallExpression.Arguments.Count() == 1)
if (methodCallExpression.Arguments.Count == 1)
{
Expression parameter = methodCallExpression.Arguments[0];
if (parameter.NodeType == ExpressionType.Lambda)
Expand Down

0 comments on commit 51686cb

Please sign in to comment.