Skip to content

Commit fe291a2

Browse files
brettsamjviau
andauthored
bumping stylecop and addressing all errors (#8975)
Co-authored-by: Jacob Viau <[email protected]>
1 parent eace58f commit fe291a2

File tree

45 files changed

+118
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+118
-131
lines changed

src/WebJobs.Script.Abstractions/WebJobs.Script.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.21.0" />
3939
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
4040
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />
41-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
41+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
4242
<PrivateAssets>all</PrivateAssets>
4343
</PackageReference>
4444
</ItemGroup>

src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal class GrpcWorkerChannel : IRpcWorkerChannel, IDisposable
5050
private readonly IOptions<WorkerConcurrencyOptions> _workerConcurrencyOptions;
5151
private readonly WaitCallback _processInbound;
5252
private readonly object _syncLock = new object();
53-
private readonly Dictionary<MsgType, Queue<PendingItem>> _pendingActions = new ();
53+
private readonly Dictionary<MsgType, Queue<PendingItem>> _pendingActions = new();
5454
private readonly ChannelWriter<OutboundGrpcEvent> _outbound;
5555
private readonly ChannelReader<InboundGrpcEvent> _inbound;
5656
private readonly IOptions<FunctionsHostingConfigOptions> _hostingConfigOptions;

src/WebJobs.Script.Grpc/Extensions/ScriptInvocationContextExtensions.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Diagnostics;
76
using System.IO;
87
using System.Linq;
98
using System.Text;
@@ -53,12 +52,12 @@ public static async Task<InvocationRequest> ToRpcInvocationRequest(this ScriptIn
5352
if (isSharedMemoryDataTransferEnabled)
5453
{
5554
// Try to transfer this data over shared memory instead of RPC
56-
if (input.val == null || !sharedMemValueCache.TryGetValue(input.val, out sharedMemValue))
55+
if (input.Val == null || !sharedMemValueCache.TryGetValue(input.Val, out sharedMemValue))
5756
{
58-
sharedMemValue = await input.val.ToRpcSharedMemoryAsync(input.type, logger, invocationRequest.InvocationId, sharedMemoryManager);
59-
if (input.val != null)
57+
sharedMemValue = await input.Val.ToRpcSharedMemoryAsync(input.Type, logger, invocationRequest.InvocationId, sharedMemoryManager);
58+
if (input.Val != null)
6059
{
61-
sharedMemValueCache.Add(input.val, sharedMemValue);
60+
sharedMemValueCache.Add(input.Val, sharedMemValue);
6261
}
6362
}
6463
}
@@ -68,35 +67,35 @@ public static async Task<InvocationRequest> ToRpcInvocationRequest(this ScriptIn
6867
// Data was successfully transferred over shared memory; create a ParameterBinding accordingly
6968
parameterBinding = new ParameterBinding
7069
{
71-
Name = input.name,
70+
Name = input.Name,
7271
RpcSharedMemory = sharedMemValue
7372
};
7473

7574
usedSharedMemory = true;
76-
logBuilder.AppendFormat("{0}:{1},", input.name, sharedMemValue.Count);
75+
logBuilder.AppendFormat("{0}:{1},", input.Name, sharedMemValue.Count);
7776
}
7877
else
7978
{
80-
if (!TryConvertObjectIfNeeded(input.val, logger, out object val))
79+
if (!TryConvertObjectIfNeeded(input.Val, logger, out object val))
8180
{
8281
// Conversion did not take place, keep the existing value as it is
83-
val = input.val;
82+
val = input.Val;
8483
}
8584

8685
// Data was not transferred over shared memory (either disabled, type not supported or some error); resort to RPC
8786
TypedData rpcValue = null;
8887
if (val == null || !rpcValueCache.TryGetValue(val, out rpcValue))
8988
{
9089
rpcValue = await val.ToRpc(logger, capabilities);
91-
if (input.val != null)
90+
if (input.Val != null)
9291
{
9392
rpcValueCache.Add(val, rpcValue);
9493
}
9594
}
9695

9796
parameterBinding = new ParameterBinding
9897
{
99-
Name = input.name,
98+
Name = input.Name,
10099
Data = rpcValue
101100
};
102101
}

src/WebJobs.Script.Grpc/WebJobs.Script.Grpc.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.21.0" />
2828
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.21.0" />
2929
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
30-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
30+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
3131
<PrivateAssets>all</PrivateAssets>
3232
</PackageReference>
3333
<PackageReference Include="System.Threading.Channels" Version="6.0.0" />

src/WebJobs.Script.WebHost/Extensions/ExceptionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace System
77
{
88
internal static class ExceptionExtensions
99
{
10-
public static (string exceptionType, string exceptionMessage, string exceptionDetails) GetExceptionDetails(this Exception exception)
10+
public static (string ExceptionType, string ExceptionMessage, string ExceptionDetails) GetExceptionDetails(this Exception exception)
1111
{
1212
if (exception == null)
1313
{

src/WebJobs.Script.WebHost/Management/FunctionsSyncManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ internal HttpRequestMessage BuildSetTriggersRequest()
687687

688688
// This function will call POST https://{app}.azurewebsites.net/operation/settriggers with the content
689689
// of triggers. It'll verify app ownership using a SWT token valid for 5 minutes. It should be plenty.
690-
private async Task<(bool, string)> SetTriggersAsync(string content)
690+
private async Task<(bool Success, string ErrorMessage)> SetTriggersAsync(string content)
691691
{
692692
var token = SimpleWebTokenHelper.CreateToken(DateTime.UtcNow.AddMinutes(5));
693693

src/WebJobs.Script.WebHost/Management/IWebFunctionsManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public interface IWebFunctionsManager
1212
{
1313
Task<IEnumerable<FunctionMetadataResponse>> GetFunctionsMetadata(bool includeProxies);
1414

15-
Task<(bool, FunctionMetadataResponse)> TryGetFunction(string name, HttpRequest request);
15+
Task<(bool Success, FunctionMetadataResponse Response)> TryGetFunction(string name, HttpRequest request);
1616

17-
Task<(bool, bool, FunctionMetadataResponse)> CreateOrUpdate(string name, FunctionMetadataResponse functionMetadata, HttpRequest request);
17+
Task<(bool Success, bool ConfigChanged, FunctionMetadataResponse Response)> CreateOrUpdate(string name, FunctionMetadataResponse functionMetadata, HttpRequest request);
1818

19-
Task<(bool, string)> TryDeleteFunction(FunctionMetadataResponse function);
19+
Task<(bool Success, string ErrorMessage)> TryDeleteFunction(FunctionMetadataResponse function);
2020
}
2121
}

src/WebJobs.Script.WebHost/Management/InstanceManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public async Task<string> ValidateContext(HostAssignmentContext assignmentContex
214214
}
215215
}
216216

217-
private async Task<(string, long?)> ValidateBlobPackageContext(RunFromPackageContext context)
217+
private async Task<(string Error, long? ContentLength)> ValidateBlobPackageContext(RunFromPackageContext context)
218218
{
219219
string blobUri = context.Url;
220220
string eventName = context.IsWarmUpRequest

src/WebJobs.Script.WebHost/Management/LinuxSpecialization/BashCommandHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System;
55
using System.Diagnostics;
6-
using Microsoft.Azure.WebJobs.Logging;
76
using Microsoft.Azure.WebJobs.Script.Diagnostics;
87
using Microsoft.Extensions.Logging;
98

@@ -22,7 +21,7 @@ public BashCommandHandler(IMetricsLogger metricsLogger, ILogger<BashCommandHandl
2221
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
2322
}
2423

25-
public (string, string, int) RunBashCommand(string command, string metricName)
24+
public (string Output, string Error, int ExitCode) RunBashCommand(string command, string metricName)
2625
{
2726
try
2827
{

src/WebJobs.Script.WebHost/Management/LinuxSpecialization/IBashCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ namespace Microsoft.Azure.WebJobs.Script.WebHost.Management.LinuxSpecialization
55
{
66
public interface IBashCommandHandler
77
{
8-
(string, string, int) RunBashCommand(string command, string metricName);
8+
(string Output, string Error, int ExitCode) RunBashCommand(string command, string metricName);
99
}
1010
}

0 commit comments

Comments
 (0)