Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcparkyn committed Nov 23, 2023
1 parent ad17cb4 commit b0858b6
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ csharp_style_namespace_declarations=file_scoped:warning
csharp_using_directive_placement = inside_namespace:warning
dotnet_style_namespace_match_folder=true:warning

# IDE0005: Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = warning
# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = warning

# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:refactoring
dotnet_style_qualification_for_property = false:refactoring
Expand Down Expand Up @@ -319,8 +324,3 @@ dotnet_diagnostic.IDE2004.severity = warning
# CA1822: Make member static
# There is a risk of accidentally breaking an internal API that partners rely on though IVT.
dotnet_code_quality.CA1822.api_surface = private

# IDE0005: Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = warning
# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = warning
1 change: 0 additions & 1 deletion samples/HackerNewsClient/Shared/HackerNewsApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace HackerNewsClient.Shared;

using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json.Serialization;
Expand Down
3 changes: 1 addition & 2 deletions samples/HackerNewsClient/Shared/QueryParam.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace HackerNewsClient.Shared;

using System.Globalization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.WebUtilities;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

public sealed class QueryParam
{
Expand Down
6 changes: 3 additions & 3 deletions samples/PhetchBlazorDemo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Components.Web;
using Blazored.LocalStorage;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using PhetchBlazorDemo;
using MudBlazor.Services;
using Blazored.LocalStorage;
using PhetchBlazorDemo;
using PhetchBlazorDemo.Shared;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
Expand Down
2 changes: 1 addition & 1 deletion src/Phetch.Blazor/UseEndpoint.razor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Phetch.Blazor;

using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Components;
using Phetch.Core;
using System.Diagnostics.CodeAnalysis;

/// <summary>
/// A component that can be used to call an endpoint and access the result.
Expand Down
4 changes: 3 additions & 1 deletion src/Phetch.Core/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
namespace System.Runtime.CompilerServices;
#pragma warning disable IDE0130 // Namespace does not match folder structure
namespace System.Runtime.CompilerServices;
#pragma warning restore IDE0130 // Namespace does not match folder structure

internal static class IsExternalInit { }
4 changes: 2 additions & 2 deletions src/Phetch.Core/RetryHandler.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Phetch.Core;

using System;
using System.Threading.Tasks;
using System.Threading;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// An interface to allow queries to be retried when they fail.
Expand Down
13 changes: 6 additions & 7 deletions test/Phetch.Blazor.Tests/BlazorTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@

using System;
using System.Collections.Generic;
using System.Linq;

internal static class BlazorTestHelpers
{
public static (Action<T>, List<T>) MakeMonitoredAction<T>()
{
var actionCalls = new List<T>();
var action = (T arg) =>
void Action(T arg)
{
actionCalls.Add(arg);
};
return (action, actionCalls);
}
return (Action, actionCalls);
}

public static (Action, List<object?>) MakeMonitoredAction()
{
var actionCalls = new List<object?>();
var action = () =>
void Action()
{
actionCalls.Add(null);
};
return (action, actionCalls);
}
return (Action, actionCalls);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using FluentAssertions.Execution;
@using System.Collections.Specialized;
@using Phetch.Tests
@inherits TestContext

@code {
Expand Down
3 changes: 2 additions & 1 deletion test/Phetch.Tests/MockQueryFunction.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace Phetch.Core;
namespace Phetch.Tests;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Phetch.Core;

/// <summary>
/// Class for creating query functions for testing.
Expand Down
2 changes: 1 addition & 1 deletion test/Phetch.Tests/OptionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Phetch.Tests;

using System;
using FluentAssertions;
using FluentAssertions.Execution;
using Phetch.Core;
using System;
using Xunit;

public class OptionsTests
Expand Down
11 changes: 5 additions & 6 deletions test/Phetch.Tests/TestHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace Phetch.Tests;

using System.Collections.Generic;
using System;
using System.Threading.Tasks;
using System.Linq;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Phetch.Core;
using Polly;

Expand All @@ -23,13 +22,13 @@ public static async Task<T> ReturnAsync<T>(T value)
public static (Func<int, Task<string>> queryFn, IReadOnlyList<int> queryFnCalls) MakeTrackedQueryFn()
{
var queryFnCalls = new List<int>();
var queryFn = async (int val) =>
async Task<string> QueryFn(int val)
{
queryFnCalls.Add(val);
await Task.Yield();
return val.ToString();
};
return (queryFn, queryFnCalls);
}
return (QueryFn, queryFnCalls);
}
}

Expand Down

0 comments on commit b0858b6

Please sign in to comment.