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

[main] Update dependencies from dotnet/roslyn-analyzers #87768

Merged
merged 17 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
2f7355d
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 19, 2023
a82e1b6
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 20, 2023
18b3e3a
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 21, 2023
7c214eb
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 22, 2023
d5241a0
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 24, 2023
b70a82a
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 28, 2023
ee99554
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 29, 2023
bd67cd9
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jun 30, 2023
906b889
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jul 1, 2023
409962a
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jul 4, 2023
a1e864a
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jul 5, 2023
be50358
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jul 7, 2023
abe7d35
Suppress RS1038 analyzer
buyaa-n Jul 7, 2023
44c5c81
Fix new faiulures found with CA1859 analyzer updates
buyaa-n Jul 7, 2023
9ac104a
Merge branch 'main' of github.com:dotnet/runtime into darc-main-168fb…
buyaa-n Jul 7, 2023
764293b
Disable CA2261 on test projects, fix more CA1859 findings
buyaa-n Jul 7, 2023
3d61a60
Update dependencies from https://github.com/dotnet/roslyn-analyzers b…
dotnet-maestro[bot] Jul 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eng/CodeAnalysis.src.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,9 @@ dotnet_diagnostic.CA2259.severity = warning
# CA2260: Use correct type parameter
dotnet_diagnostic.CA2260.severity = warning

# CA2261: Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
dotnet_diagnostic.CA2261.severity = warning

# CA2300: Do not use insecure deserializer BinaryFormatter
dotnet_diagnostic.CA2300.severity = none

Expand Down
3 changes: 3 additions & 0 deletions eng/CodeAnalysis.test.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ dotnet_diagnostic.CA2259.severity = none
# CA2260: Use correct type parameter
dotnet_diagnostic.CA2260.severity = none

# CA2261: Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
dotnet_diagnostic.CA2261.severity = none

# CA2300: Do not use insecure deserializer BinaryFormatter
dotnet_diagnostic.CA2300.severity = none

Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7787409c6b529c021d4f8b5fbe3d620094953be9</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23308.2">
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23357.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>2f0301ef59624a72fb00f7fd92caa50be03f277d</Sha>
<Sha>82603c16509d7383cd1922680773a79b839b1705</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23308.2">
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23357.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>2f0301ef59624a72fb00f7fd92caa50be03f277d</Sha>
<Sha>82603c16509d7383cd1922680773a79b839b1705</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="8.0.100-preview.7.23329.3">
<Uri>https://github.com/dotnet/sdk</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
</ItemGroup>
<PropertyGroup>
<!-- dotnet/roslyn-analyzers dependencies -->
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.5-beta1.23308.2</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23308.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.23357.1</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23357.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- dotnet/roslyn dependencies -->
<!--
These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,10 @@ internal Delegate CreateDelegateNoThrowOnBindFailure(RuntimeTypeInfo runtimeDele
return null;
}

#pragma warning disable CA1859 // Use concrete types when possible for improved performance https://github.com/dotnet/roslyn-analyzers/issues/6751
IList<ParameterInfo> delegateParameters = invokeMethod.GetParametersNoCopy();
IList<ParameterInfo> targetParameters = this.GetParametersNoCopy();
#pragma warning restore CA1859
IEnumerator<ParameterInfo> delegateParameterEnumerator = delegateParameters.GetEnumerator();
IEnumerator<ParameterInfo> targetParameterEnumerator = targetParameters.GetEnumerator();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public IEnumerable<P> ComputeVerticesInvolvedInAFlaggedCycle()
}
#endif

return verticesInAFlaggedCycleTarjanStyle.Select(v => v.Payload).ToArray();
return verticesInAFlaggedCycleTarjanStyle.Select(v => v.Payload);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public EagerlyBuiltVTableSliceNode(TypeDesc type)
{
}

private static IReadOnlyList<MethodDesc> ComputeSlots(TypeDesc type)
private static MethodDesc[] ComputeSlots(TypeDesc type)
{
var slots = default(ArrayBuilder<MethodDesc>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private static ExceptionInfo GetExceptionInfo(Exception? exception)
/// <summary>
/// Converts an ILogger state object into a set of key-value pairs (That can be send to a EventSource)
/// </summary>
private static IReadOnlyList<KeyValuePair<string, string?>> GetProperties(object? state)
private static KeyValuePair<string, string?>[] GetProperties(object? state)
{
if (state is IReadOnlyList<KeyValuePair<string, object?>> keyValuePairs)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static partial class Enumerable
{
public static IEnumerable<TResult> Empty<TResult>() => Array.Empty<TResult>();

private static IEnumerable<TResult>? GetEmptyIfEmpty<TSource, TResult>(IEnumerable<TSource> source) =>
private static TResult[]? GetEmptyIfEmpty<TSource, TResult>(IEnumerable<TSource> source) =>
source is TSource[] { Length: 0 } ?
Array.Empty<TResult>() :
null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override void InitIDs()
}

[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
private object GenerateMembersElement(XmlMembersMapping xmlMembersMapping)
private object?[] GenerateMembersElement(XmlMembersMapping xmlMembersMapping)
{
if (xmlMembersMapping.Accessor.IsSoap)
{
Expand All @@ -102,7 +102,7 @@ private object GenerateMembersElement(XmlMembersMapping xmlMembersMapping)
}

[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
private object GenerateLiteralMembersElement(XmlMembersMapping xmlMembersMapping)
private object[] GenerateLiteralMembersElement(XmlMembersMapping xmlMembersMapping)
{
ElementAccessor element = xmlMembersMapping.Accessor;
MemberMapping[] mappings = ((MembersMapping)element.Mapping!).Members!;
Expand Down Expand Up @@ -322,7 +322,7 @@ private static void InitializeValueTypes(object?[] p, MemberMapping[] mappings)
}

[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
private object GenerateEncodedMembersElement(XmlMembersMapping xmlMembersMapping)
private object?[] GenerateEncodedMembersElement(XmlMembersMapping xmlMembersMapping)
{
ElementAccessor element = xmlMembersMapping.Accessor;
var membersMapping = (MembersMapping)element.Mapping!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<IsRoslynComponent>true</IsRoslynComponent>
<!-- Disable RS2008: Enable analyzer release tracking
Diagnostics in runtime use a different mechanism (docs/project/list-of-diagnostics.md) -->
<NoWarn>RS2008;$(NoWarn)</NoWarn>
<NoWarn>RS2008;RS1038;$(NoWarn)</NoWarn>
<DefineConstants>$(DefineConstants);JSIMPORTGENERATOR</DefineConstants>
<AnalyzerLanguage>cs</AnalyzerLanguage>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<IsRoslynComponent>true</IsRoslynComponent>
<!-- Disable RS2008: Enable analyzer release tracking
Diagnostics in runtime use a different mechanism (docs/project/list-of-diagnostics.md) -->
<NoWarn>RS2008;$(NoWarn)</NoWarn>
<NoWarn>RS2008;RS1038;$(NoWarn)</NoWarn>
<AnalyzerLanguage>cs</AnalyzerLanguage>
<DefineConstants>$(DefineConstants);MICROSOFT_INTEROP_COMINTERFACEGENERATOR</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<IsRoslynComponent>true</IsRoslynComponent>
<!-- Disable RS2008: Enable analyzer release tracking
Diagnostics in runtime use a different mechanism (docs/project/list-of-diagnostics.md) -->
<NoWarn>RS2008;$(NoWarn)</NoWarn>
<NoWarn>RS2008;RS1038;$(NoWarn)</NoWarn>
<AnalyzerLanguage>cs</AnalyzerLanguage>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ private static RecipientInfoCollection CreateRecipientInfos(SafeCryptMsgHandle h
return new RecipientInfoCollection(recipientInfos);
}

#pragma warning disable CA1859 // Use concrete types when possible for improved performance https://github.com/dotnet/roslyn-analyzers/issues/6751
private static IEnumerable<RecipientInfo> ToRecipientInfosForThisIndex(SafeHandle pCmsgCmsRecipientInfoMemory, int index)
#pragma warning restore CA1859
{
bool mustRelease = false;
pCmsgCmsRecipientInfoMemory.DangerousAddRef(ref mustRelease);
Expand Down