Skip to content

Commit c63e66d

Browse files
committed
Change: Auto Code Cleanup
1 parent 072b53b commit c63e66d

File tree

70 files changed

+413
-436
lines changed

Some content is hidden

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

70 files changed

+413
-436
lines changed

src/CodeOfChaos.Extensions.Analyzers/CodeOfChaos.Extensions.Analyzers.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
</ItemGroup>
4141

4242
<ItemGroup>
43-
<None Include="..\..\LICENSE" Pack="true" PackagePath="" Visible="false" />
44-
<None Include="README.md" Pack="true" PackagePath="" />
45-
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false" />
43+
<None Include="..\..\LICENSE" Pack="true" PackagePath="" Visible="false"/>
44+
<None Include="README.md" Pack="true" PackagePath=""/>
45+
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false"/>
4646
</ItemGroup>
4747

4848
<ItemGroup>
49-
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" />
49+
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs"/>
5050
</ItemGroup>
5151

5252
</Project>

src/CodeOfChaos.Extensions.Analyzers/GuidValidationAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void AnalyzeSyntaxNode(SyntaxNodeAnalysisContext context) {
4747
return;
4848

4949
string guidString = literalExpression.Token.ValueText;
50-
if (Guid.TryParse(guidString, out _)) return; // If the string is a valid GUID, we don't need to report a diagnostic.
50+
if (Guid.TryParse(guidString, out _)) return;// If the string is a valid GUID, we don't need to report a diagnostic.
5151

5252
var diagnostic = Diagnostic.Create(Rule, literalExpression.GetLocation(), guidString);
5353
context.ReportDiagnostic(diagnostic);

src/CodeOfChaos.Extensions.AspNetCore/CodeOfChaos.Extensions.AspNetCore.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="Serilog" Version="4.2.0" />
27-
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
26+
<PackageReference Include="Serilog" Version="4.2.0"/>
27+
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0"/>
2828
</ItemGroup>
2929

3030
<ItemGroup>
31-
<None Include="..\..\LICENSE" Pack="true" PackagePath="" Visible="false" />
32-
<None Include="README.md" Pack="true" PackagePath="" />
33-
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false" />
31+
<None Include="..\..\LICENSE" Pack="true" PackagePath="" Visible="false"/>
32+
<None Include="README.md" Pack="true" PackagePath=""/>
33+
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false"/>
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<ProjectReference Include="..\CodeOfChaos.Extensions.Serilog\CodeOfChaos.Extensions.Serilog.csproj" />
37+
<ProjectReference Include="..\CodeOfChaos.Extensions.Serilog\CodeOfChaos.Extensions.Serilog.csproj"/>
3838
</ItemGroup>
3939

4040
</Project>

src/CodeOfChaos.Extensions.AspNetCore/LoggingFactoryExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class LoggingFactoryExtensions {
1818
/// <returns>An instance of <see cref="ILoggerFactory" /> configured with Serilog.</returns>
1919
public static ILoggerFactory CreateWithSerilog()
2020
=> LoggerFactory.Create(builder => builder.AddSerilog(Log.Logger));
21-
21+
2222
/// <summary>
2323
/// Creates a new instance of <see cref="ILoggerFactory" /> configured with Serilog.
2424
/// </summary>

src/CodeOfChaos.Extensions.AspNetCore/LoggingOverrideExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Microsoft.Extensions.Logging;
77
using Serilog;
88
using Serilog.Core;
9-
using ILogger=Serilog.ILogger;
109

1110
namespace CodeOfChaos.Extensions.AspNetCore;
1211
// ---------------------------------------------------------------------------------------------------------------------
@@ -33,12 +32,12 @@ public static WebApplicationBuilder OverrideLoggingWithSerilog(
3332
configure?.Invoke(loggerConfig);
3433

3534
Log.Logger = loggerConfig.CreateLogger();
36-
35+
3736
// Clear default providers and setup Serilog
3837
builder.Logging.ClearProviders();
3938
builder.Services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(Log.Logger));
4039
builder.Services.AddSingleton(Log.Logger);
41-
40+
4241
return builder;
4342
}
4443
}

src/CodeOfChaos.Extensions.DependencyInjection.Generators/CodeOfChaos.Extensions.DependencyInjection.Generators.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<None Include="../../LICENSE" Pack="true" PackagePath="" Visible="false" />
31-
<None Include="../../src/CodeOfChaos.Extensions.DependencyInjection/README.md" Pack="true" PackagePath="" />
32-
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false" />
30+
<None Include="../../LICENSE" Pack="true" PackagePath="" Visible="false"/>
31+
<None Include="../../src/CodeOfChaos.Extensions.DependencyInjection/README.md" Pack="true" PackagePath=""/>
32+
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false"/>
3333
</ItemGroup>
3434

3535
<ItemGroup>
3636
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
3737
<PrivateAssets>all</PrivateAssets>
3838
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3939
</PackageReference>
40-
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.13.0" />
40+
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.13.0"/>
4141
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0">
4242
<PrivateAssets>all</PrivateAssets>
4343
</PackageReference>
4444
</ItemGroup>
4545

4646
<ItemGroup>
47-
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
47+
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false"/>
4848
</ItemGroup>
4949

5050

src/CodeOfChaos.Extensions.DependencyInjection.Generators/Helpers/StringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace CodeOfChaos.Extensions.DependencyInjection.Generators.Helpers;
1010
// Code
1111
// ---------------------------------------------------------------------------------------------------------------------
1212
public static class StringExtensions {
13-
private static readonly FrozenSet<string> ValidLifeTimes = new[] {"Singleton","Scoped","Transient"}.ToFrozenSet();
13+
private static readonly FrozenSet<string> ValidLifeTimes = new[] { "Singleton", "Scoped", "Transient" }.ToFrozenSet();
1414
public static bool TryGetAsServiceLifetimeString(this MemberAccessExpressionSyntax input, [NotNullWhen(true)] out string? output) {
1515
output = input.Name.Identifier.Text;
1616
return ValidLifeTimes.Contains(output);

src/CodeOfChaos.Extensions.DependencyInjection.Generators/Helpers/SymbolResolver.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Microsoft.CodeAnalysis;
55

66
namespace CodeOfChaos.Extensions.DependencyInjection.Generators.Helpers;
7-
87
// ---------------------------------------------------------------------------------------------------------------------
98
// Code
109
// ---------------------------------------------------------------------------------------------------------------------
@@ -14,7 +13,5 @@ public interface ISymbolResolver {
1413

1514
// Simple wrapper to make testing not a living hell.
1615
public class SymbolResolver(SemanticModel model) : ISymbolResolver {
17-
public ISymbol? ResolveSymbol(SyntaxNode node) {
18-
return model.GetSymbolInfo(node).Symbol;
19-
}
16+
public ISymbol? ResolveSymbol(SyntaxNode node) => model.GetSymbolInfo(node).Symbol;
2017
}

src/CodeOfChaos.Extensions.DependencyInjection.Generators/Registrations/FactoryCreatedServiceRegistration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void FormatText(StringBuilder builder, string _) {
2727
.IndentLine(2, $"services.Add{LifeTime}<{ServiceTypeName.ToDisplayString()}>(")
2828
.IndentLine(3, $"(provider) => provider.GetRequiredService<{FactoryTypeName.ToDisplayString()}>().Create()")
2929
.IndentLine(2, ");")
30-
;
30+
;
3131
}
3232

3333
// -----------------------------------------------------------------------------------------------------------------

src/CodeOfChaos.Extensions.DependencyInjection.Generators/Registrations/InjectablePoolableServiceRegistration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ out InjectablePoolableServiceRegistration registration
4646

4747
if (genericNameSyntax?.TypeArgumentList.Arguments is not { Count: 2 } typeArgumentsList) return false;
4848

49-
var serviceTypeSyntax = typeArgumentsList[0];
50-
var implementationTypeSyntax = typeArgumentsList[1];
49+
TypeSyntax serviceTypeSyntax = typeArgumentsList[0];
50+
TypeSyntax implementationTypeSyntax = typeArgumentsList[1];
5151

5252
var serviceNamedTypeSymbol = resolver.ResolveSymbol(serviceTypeSyntax) as INamedTypeSymbol;
5353
var implementationTypeSymbol = resolver.ResolveSymbol(implementationTypeSyntax) as INamedTypeSymbol;

0 commit comments

Comments
 (0)