Skip to content

Commit

Permalink
Fixing warnings and minor code cleanup. (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocav authored Sep 8, 2022
1 parent a7fb070 commit 90e6f92
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AssemblyName>Microsoft.Azure.Functions.Worker.Extensions.SignalRService</AssemblyName>
<RootNamespace>Microsoft.Azure.Functions.Worker.Extensions.SignalRService</RootNamespace>
<Description>Azure SignalR Service extensions for .NET isolated functions</Description>

<Nullable>annotations</Nullable>
<!--Version information-->
<VersionPrefix>1.8.0</VersionPrefix>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace Microsoft.Azure.Functions.Worker
{
/// <summary>
/// Attribute used to configure a parameter as the input target for the Azure Storage Tables binding.
/// </summary>
public class TableInputAttribute : InputBindingAttribute
{
/// <summary>Initializes a new instance of the <see cref="TableInputAttribute"/> class.</summary>
Expand Down Expand Up @@ -40,11 +43,11 @@ public TableInputAttribute(string tableName, string partitionKey, string rowKey)

/// <summary>When binding to a table entity, gets the partition key of the entity.</summary>
/// <remarks>When binding to an entire table, returns <see langword="null"/>.</remarks>
public string PartitionKey { get; }
public string? PartitionKey { get; }

/// <summary>When binding to a table entity, gets the row key of the entity.</summary>
/// <remarks>When binding to an entire table, returns <see langword="null"/>.</remarks>
public string RowKey { get; }
public string? RowKey { get; }

/// <summary>
/// Allow arbitrary table filter. RowKey should be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Microsoft.Azure.Functions.Worker
{
/// <summary>
/// Attribute used to configure the source of the Azure Storage Tables output binding.
/// </summary>
public class TableOutputAttribute : OutputBindingAttribute
{
/// <summary>Initializes a new instance of the <see cref="TableOutputAttribute"/> class.</summary>
Expand Down Expand Up @@ -37,11 +40,11 @@ public TableOutputAttribute(string tableName, string partitionKey, string rowKey

/// <summary>When binding to a table entity, gets the partition key of the entity.</summary>
/// <remarks>When binding to an entire table, returns <see langword="null"/>.</remarks>
public string PartitionKey { get; }
public string? PartitionKey { get; }

/// <summary>When binding to a table entity, gets the row key of the entity.</summary>
/// <remarks>When binding to an entire table, returns <see langword="null"/>.</remarks>
public string RowKey { get; }
public string? RowKey { get; }

/// <summary>
/// Gets or sets the app setting name that contains the Azure Storage connection string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ public IFunctionInvoker Create(FunctionDefinition definition)

private static IFunctionInvoker CreateGeneric<TReflected, TReturnValue>(MethodInfo method, IMethodInvokerFactory methodInvokerFactory, IFunctionActivator functionActivator)
{
List<string?> parameterNames = method.GetParameters().Select(p => p.Name).ToList();

IMethodInvoker<TReflected, TReturnValue> methodInvoker = methodInvokerFactory.Create<TReflected, TReturnValue>(method);

return new DefaultFunctionInvoker<TReflected, TReturnValue>(methodInvoker, functionActivator);
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetWorker.Core/Logging/LogConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static class LogConstants
/// <summary>
/// Gets the event id for a metric event.
/// </summary>
internal readonly static EventId MetricEventId = new EventId(1, "MS_LogMetric");
internal static readonly EventId MetricEventId = new EventId(1, "MS_LogMetric");

/// <summary>
/// Gets the name of the key used to store a metric sum.
Expand Down
6 changes: 3 additions & 3 deletions test/DotNetWorkerTests/DotNetWorkerTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Core.NewtonsoftJson" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 5 additions & 5 deletions test/E2ETests/E2ETests/E2ETests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.13.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.11.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.13.1" />
<PackageReference Include="Azure.Storage.Queues" Version="12.11.1" />
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.13.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions test/FunctionMetadataGeneratorTests/SdkTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Mono.Cecil" Version="0.11.3" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);NU1701</NoWarn>
<NoWarn>$(NoWarn);NU1701;RS1014</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.0.1-beta1.21126.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions test/Sdk.Generator.Tests/Sdk.Generator.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.*" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions test/SdkE2ETests/SdkE2ETests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.9.0" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion test/TestUtility/TestUtility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions test/Worker.Extensions.Sample/Worker.Extensions.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 90e6f92

Please sign in to comment.