Skip to content

Commit

Permalink
update StyleCop version and fix style errors. (Azure#1436)
Browse files Browse the repository at this point in the history
Update StyleCop version and fix style errors.
  • Loading branch information
philipktlin authored Jul 11, 2019
1 parent e261c3c commit 963612a
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 57 deletions.
16 changes: 8 additions & 8 deletions Microsoft.Azure.Devices.Edge.sln
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ Global
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Debug|Any CPU.Build.0 = Debug|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Release|Any CPU.ActiveCfg = Release|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Release|Any CPU.Build.0 = Release|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CheckInBuild|Any CPU.ActiveCfg = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CheckInBuild|Any CPU.Build.0 = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -562,24 +562,24 @@ Global
{A68ABCD4-5926-4005-9525-559DD74991C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A68ABCD4-5926-4005-9525-559DD74991C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A68ABCD4-5926-4005-9525-559DD74991C9}.Release|Any CPU.Build.0 = Release|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CheckInBuild|Any CPU.ActiveCfg = Debug|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CheckInBuild|Any CPU.Build.0 = Debug|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.Release|Any CPU.Build.0 = Release|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.CheckInBuild|Any CPU.ActiveCfg = Debug|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.CheckInBuild|Any CPU.Build.0 = Debug|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B63C506E-5CB5-4DE8-8275-F7BA8354799E}.Release|Any CPU.Build.0 = Release|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.CheckInBuild|Any CPU.ActiveCfg = Debug|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.CheckInBuild|Any CPU.Build.0 = Debug|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Planners
using Nito.AsyncEx;
using DiffState = System.ValueTuple<
// added modules
System.Collections.Generic.IList<IModule>,
System.Collections.Generic.IList<Microsoft.Azure.Devices.Edge.Agent.Core.IModule>,

// updated modules because of deployment
System.Collections.Generic.IList<IModule>,
System.Collections.Generic.IList<Microsoft.Azure.Devices.Edge.Agent.Core.IModule>,

// modules whose desired status changed because of deployment
System.Collections.Generic.IList<IModule>,
System.Collections.Generic.IList<Microsoft.Azure.Devices.Edge.Agent.Core.IModule>,

// update modules because runtime state changed
System.Collections.Generic.IList<IRuntimeModule>,
System.Collections.Generic.IList<Microsoft.Azure.Devices.Edge.Agent.Core.IRuntimeModule>,

// removed modules
System.Collections.Generic.IList<IRuntimeModule>,
System.Collections.Generic.IList<Microsoft.Azure.Devices.Edge.Agent.Core.IRuntimeModule>,

// modules that are running great
System.Collections.Generic.IList<IRuntimeModule>
System.Collections.Generic.IList<Microsoft.Azure.Devices.Edge.Agent.Core.IRuntimeModule>
>;

public class HealthRestartPlanner : IPlanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.IoTHub
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Azure.Devices.Edge.Util.TransientFaultHandling;
using Microsoft.Extensions.Logging;
using ExponentialBackoff = Util.TransientFaultHandling.ExponentialBackoff;
using ExponentialBackoff = Microsoft.Azure.Devices.Edge.Util.TransientFaultHandling.ExponentialBackoff;

public class ModuleClientProvider : IModuleClientProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
<HighEntropyVA>true</HighEntropyVA>
</PropertyGroup>

<ItemGroup>
<Folder Include="commands\" />
<Folder Include="planners\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="KubernetesClient" Version="1.5.18" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Core.Test.Commands
using Microsoft.Extensions.Logging;
using Moq;
using Xunit;
using CommandMethodExpr = System.Linq.Expressions.Expression<System.Func<ICommandFactory, System.Threading.Tasks.Task<ICommand>>>;
using TestExecutionExpr = System.Func<LoggingCommandFactory, System.Threading.Tasks.Task<ICommand>>;
using CommandMethodExpr = System.Linq.Expressions.Expression<System.Func<Microsoft.Azure.Devices.Edge.Agent.Core.ICommandFactory, System.Threading.Tasks.Task<Microsoft.Azure.Devices.Edge.Agent.Core.ICommand>>>;
using TestExecutionExpr = System.Func<Microsoft.Azure.Devices.Edge.Agent.Core.LoggingCommandFactory, System.Threading.Tasks.Task<Microsoft.Azure.Devices.Edge.Agent.Core.ICommand>>;

class FailureCommand : ICommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Devices.Edge.Hub.Core.Routing
using Constants = Microsoft.Azure.Devices.Edge.Hub.Core.Constants;
using IMessage = Microsoft.Azure.Devices.Edge.Hub.Core.IMessage;
using IRoutingMessage = Microsoft.Azure.Devices.Routing.Core.IMessage;
using ISinkResult = Microsoft.Azure.Devices.Routing.Core.ISinkResult<Devices.Routing.Core.IMessage>;
using ISinkResult = Microsoft.Azure.Devices.Routing.Core.ISinkResult<Microsoft.Azure.Devices.Routing.Core.IMessage>;
using SystemProperties = Microsoft.Azure.Devices.Edge.Hub.Core.SystemProperties;

public class CloudEndpoint : Endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Devices.Edge.Hub.Core.Routing
using static System.FormattableString;
using IMessage = Microsoft.Azure.Devices.Edge.Hub.Core.IMessage;
using IRoutingMessage = Microsoft.Azure.Devices.Routing.Core.IMessage;
using ISinkResult = Microsoft.Azure.Devices.Routing.Core.ISinkResult<Devices.Routing.Core.IMessage>;
using ISinkResult = Microsoft.Azure.Devices.Routing.Core.ISinkResult<Microsoft.Azure.Devices.Routing.Core.IMessage>;
using Option = Microsoft.Azure.Devices.Edge.Util.Option;

public class ModuleEndpoint : Endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ public NullCheckpointStore(long offset)
var data = new CheckpointData(offset);
this.initialCheckpointData = Task.FromResult(data);
this.initialCheckpointDataMap = Task.FromResult(
new Dictionary<string, CheckpointData>()
{
{ "NullCheckpoint", data }
}
as IDictionary<string, CheckpointData>);
(IDictionary<string, CheckpointData>)new Dictionary<string, CheckpointData>()
{
{ "NullCheckpoint", data }
});
}

public static NullCheckpointStore Instance { get; } = new NullCheckpointStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Devices.Routing.Core.Endpoints
using Microsoft.Extensions.Logging;
using Nito.AsyncEx;
using static System.FormattableString;
using AsyncLock = Edge.Util.Concurrency.AsyncLock;
using AsyncLock = Microsoft.Azure.Devices.Edge.Util.Concurrency.AsyncLock;

public class StoringAsyncEndpointExecutor : IEndpointExecutor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.Azure.Devices.Edge.Hub.Core.Test
using System.Collections.Generic;
using Microsoft.Azure.Devices.Edge.Util.Test.Common;
using Xunit;
using Message = EdgeMessage;
using Message = Microsoft.Azure.Devices.Edge.Hub.Core.EdgeMessage;

public class MessageTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Devices.Edge.Hub.Core.Test.Routing
using Xunit;
using Constants = Microsoft.Azure.Devices.Edge.Hub.Core.Constants;
using IMessage = Microsoft.Azure.Devices.Edge.Hub.Core.IMessage;
using Message = EdgeMessage;
using Message = Microsoft.Azure.Devices.Edge.Hub.Core.EdgeMessage;
using SystemProperties = Microsoft.Azure.Devices.Edge.Hub.Core.SystemProperties;

[Unit]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Devices.Edge.Hub.Core.Test.Routing
using Xunit;
using Constants = Microsoft.Azure.Devices.Edge.Hub.Core.Constants;
using IMessage = Microsoft.Azure.Devices.Edge.Hub.Core.IMessage;
using Message = EdgeMessage;
using Message = Microsoft.Azure.Devices.Edge.Hub.Core.EdgeMessage;
using SystemProperties = Microsoft.Azure.Devices.Edge.Hub.Core.SystemProperties;

[Integration]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup Condition="'$(DotNet_Runtime)' != 'netcoreapp3.0'">
<TargetFramework>netcoreapp2.1</TargetFramework>
<Configurations>Debug;Release;CheckInBuild</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(OS)|$(DotNet_Runtime)' == 'Unix|netcoreapp3.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.EdgeHub
class RetryPolicy
{
/// <summary>
/// Initializes a new instance of the <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
/// Initializes a new instance of the <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
/// </summary>
/// <param name="errorDetectionStrategy">The <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.ITransientErrorDetectionStrategy" /> that is responsible for detecting transient conditions.</param>
/// <param name="retryStrategy">The strategy to use for this retry policy.</param>
Expand All @@ -29,7 +29,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, Retr
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and default fixed time interval between retries.
/// Initializes a new instance of the <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and default fixed time interval between retries.
/// </summary>
/// <param name="errorDetectionStrategy">The <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.ITransientErrorDetectionStrategy" /> that is responsible for detecting transient conditions.</param>
/// <param name="retryCount">The number of retry attempts.</param>
Expand All @@ -39,7 +39,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and fixed time interval between retries.
/// Initializes a new instance of the <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and fixed time interval between retries.
/// </summary>
/// <param name="errorDetectionStrategy">The <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.ITransientErrorDetectionStrategy" /> that is responsible for detecting transient conditions.</param>
/// <param name="retryCount">The number of retry attempts.</param>
Expand All @@ -50,7 +50,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and backoff parameters for calculating the exponential delay between retries.
/// Initializes a new instance of the <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and backoff parameters for calculating the exponential delay between retries.
/// </summary>
/// <param name="errorDetectionStrategy">The <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.ITransientErrorDetectionStrategy" /> that is responsible for detecting transient conditions.</param>
/// <param name="retryCount">The number of retry attempts.</param>
Expand All @@ -63,7 +63,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
/// Initializes a new instance of the <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.RetryPolicy" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
/// </summary>
/// <param name="errorDetectionStrategy">The <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.ITransientErrorDetectionStrategy" /> that is responsible for detecting transient conditions.</param>
/// <param name="retryCount">The number of retry attempts.</param>
Expand All @@ -80,24 +80,24 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
public event EventHandler<RetryingEventArgs> Retrying;

/// <summary>
/// Returns a default policy that performs no retries, but invokes the action only once.
/// Gets a default policy that performs no retries, but invokes the action only once.
/// </summary>
public static RetryPolicy NoRetry { get; } = new RetryPolicy(new TransientErrorIgnoreStrategy(), RetryStrategy.NoRetry);

/// <summary>
/// Returns a default policy that implements a fixed retry interval configured with the default <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.FixedInterval" /> retry strategy.
/// Gets a default policy that implements a fixed retry interval configured with the default <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.FixedInterval" /> retry strategy.
/// The default retry policy treats all caught exceptions as transient errors.
/// </summary>
public static RetryPolicy DefaultFixed { get; } = new RetryPolicy(new TransientErrorCatchAllStrategy(), RetryStrategy.DefaultFixed);

/// <summary>
/// Returns a default policy that implements a progressive retry interval configured with the default <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.Incremental" /> retry strategy.
/// Gets a default policy that implements a progressive retry interval configured with the default <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.Incremental" /> retry strategy.
/// The default retry policy treats all caught exceptions as transient errors.
/// </summary>
public static RetryPolicy DefaultProgressive { get; } = new RetryPolicy(new TransientErrorCatchAllStrategy(), RetryStrategy.DefaultProgressive);

/// <summary>
/// Returns a default policy that implements a random exponential retry interval configured with the default <see cref="T:Microsoft.Azure.WebJobs.Extensions.EdgeHub.FixedInterval" /> retry strategy.
/// Gets a default policy that implements a random exponential retry interval configured with the default <see cref="Microsoft.Azure.WebJobs.Extensions.EdgeHub.FixedInterval" /> retry strategy.
/// The default retry policy treats all caught exceptions as transient errors.
/// </summary>
public static RetryPolicy DefaultExponential { get; } = new RetryPolicy(new TransientErrorCatchAllStrategy(), RetryStrategy.DefaultExponential);
Expand All @@ -120,7 +120,7 @@ public virtual void ExecuteAction(Action action)
{
Guard.ArgumentNotNull(action, "action");
this.ExecuteAction<object>(
delegate
() =>
{
action();
return null;
Expand Down Expand Up @@ -221,6 +221,7 @@ public Task ExecuteAsync(Func<Task> taskAction, CancellationToken cancellationTo
/// <summary>
/// Repeatedly executes the specified asynchronous task while it satisfies the current retry policy.
/// </summary>
/// <typeparam name="TResult">Result type.</typeparam>
/// <param name="taskFunc">A function that returns a started task (also known as "hot" task).</param>
/// <returns>
/// Returns a task that will run to completion if the original task completes successfully (either the
Expand All @@ -235,6 +236,7 @@ public Task<TResult> ExecuteAsync<TResult>(Func<Task<TResult>> taskFunc)
/// <summary>
/// Repeatedly executes the specified asynchronous task while it satisfies the current retry policy.
/// </summary>
/// <typeparam name="TResult">Result type.</typeparam>
/// <param name="taskFunc">A function that returns a started task (also known as "hot" task).</param>
/// <param name="cancellationToken">The token used to cancel the retry operation. This token does not cancel the execution of the asynchronous task.</param>
/// <returns>
Expand Down
Loading

0 comments on commit 963612a

Please sign in to comment.