Skip to content

Commit d812387

Browse files
committed
Update the code to current formatting rules
1 parent 7db47dd commit d812387

Some content is hidden

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

44 files changed

+23454
-270
lines changed

AStar.Web.slnx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
<Solution>
2-
<Folder Name="/Solution Items/" />
2+
<Folder Name="/Solution Items/"/>
33
<Folder Name="/Solution Items/.github/">
4-
<File Path=".github\codeql.yml" />
5-
<File Path=".github\copilot-instructions.md" />
6-
<File Path=".github\dependabot.yml" />
4+
<File Path=".github\codeql.yml"/>
5+
<File Path=".github\copilot-instructions.md"/>
6+
<File Path=".github\dependabot.yml"/>
77
</Folder>
88
<Folder Name="/Solution Items/.github/instructions/">
9-
<File Path=".github\instructions\blazor.instructions.md" />
9+
<File Path=".github\instructions\blazor.instructions.md"/>
1010
</Folder>
1111
<Folder Name="/Solution Items/.github/prompts/">
12-
<File Path=".github\prompts\astar.prompt.md" />
13-
<File Path=".github\prompts\xunit.prompt.md" />
12+
<File Path=".github\prompts\astar.prompt.md"/>
13+
<File Path=".github\prompts\xunit.prompt.md"/>
1414
</Folder>
1515
<Folder Name="/Solution Items/.github/workflows/">
16-
<File Path=".github\workflows\main_astar-dev.yml" />
16+
<File Path=".github\workflows\main_astar-dev.yml"/>
1717
</Folder>
18-
<Folder Name="/src/" />
18+
<Folder Name="/src/"/>
1919
<Folder Name="/src/aspire/">
20-
<Project Path="src/aspire/AStar.Web.AppHost/AStar.Web.AppHost.csproj" />
21-
<Project Path="src/aspire/AStar.Web.ServiceDefaults/AStar.Web.ServiceDefaults.csproj" />
20+
<Project Path="src/aspire/AStar.Web.AppHost/AStar.Web.AppHost.csproj"/>
21+
<Project Path="src/aspire/AStar.Web.ServiceDefaults/AStar.Web.ServiceDefaults.csproj"/>
2222
</Folder>
23-
<Folder Name="/src/modules/" />
23+
<Folder Name="/src/modules/"/>
2424
<Folder Name="/src/modules/apis/">
25-
<Project Path="src/modules/apis/AStar.Web.ApiService/AStar.Web.ApiService.csproj" />
25+
<Project Path="src/modules/apis/AStar.Web.ApiService/AStar.Web.ApiService.csproj"/>
2626
</Folder>
2727
<Folder Name="/src/uis/">
28-
<Project Path="src\uis\AStar.Dev.Web\AStar.Dev.Web.csproj" />
28+
<Project Path="src\uis\AStar.Dev.Web\AStar.Dev.Web.csproj"/>
2929
</Folder>
30-
<Folder Name="/test/" />
30+
<Folder Name="/test/"/>
3131
<Folder Name="/test/aspire/">
32-
<Project Path="test/aspire/AStar.Web.Tests/AStar.Web.Tests.csproj" />
32+
<Project Path="test/aspire/AStar.Web.Tests/AStar.Web.Tests.csproj"/>
3333
</Folder>
3434
</Solution>

src/aspire/AStar.Web.AppHost/AStar.Web.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<ItemGroup>
1212
<ProjectReference Include="..\..\modules\apis\AStar.Web.ApiService\AStar.Web.ApiService.csproj"/>
13-
<ProjectReference Include="..\..\uis\AStar.Dev.Web\AStar.Dev.Web.csproj" />
13+
<ProjectReference Include="..\..\uis\AStar.Dev.Web\AStar.Dev.Web.csproj"/>
1414
</ItemGroup>
1515

1616
</Project>

src/aspire/AStar.Web.AppHost/AppHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
.WithReference(apiService)
1212
.WaitFor(apiService);
1313

14-
builder.Build().Run();
14+
builder.Build().Run();

src/aspire/AStar.Web.ServiceDefaults/AStar.Web.ServiceDefaults.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0"/>
1414
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.0.0"/>
15-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
16-
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
17-
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
18-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
19-
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0" />
15+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0"/>
16+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0"/>
17+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0"/>
18+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0"/>
19+
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0"/>
2020
</ItemGroup>
2121

2222
</Project>

src/aspire/AStar.Web.ServiceDefaults/Extensions.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ public static TBuilder ConfigureOpenTelemetry<TBuilder>(this TBuilder builder)
6262
.WithTracing(tracing =>
6363
{
6464
tracing.AddSource(builder.Environment.ApplicationName)
65-
.AddAspNetCoreInstrumentation(tracing =>
65+
.AddAspNetCoreInstrumentation(instrumentationOptions =>
6666
// Exclude health check requests from tracing
67-
tracing.Filter = context =>
68-
!context.Request.Path.StartsWithSegments(HealthEndpointPath)
69-
&& !context.Request.Path.StartsWithSegments(AlivenessEndpointPath)
67+
instrumentationOptions.Filter = context => !context.Request.Path.StartsWithSegments(HealthEndpointPath)
68+
&& !context.Request.Path.StartsWithSegments(AlivenessEndpointPath)
7069
)
7170
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
7271
//.AddGrpcClientInstrumentation()
@@ -109,18 +108,17 @@ public static WebApplication MapDefaultEndpoints(this WebApplication app)
109108
{
110109
// Adding health checks endpoints to applications in non-development environments has security implications.
111110
// See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments.
112-
if (app.Environment.IsDevelopment())
113-
{
114-
// All health checks must pass for app to be considered ready to accept traffic after starting
115-
app.MapHealthChecks(HealthEndpointPath);
111+
if (!app.Environment.IsDevelopment()) return app;
112+
113+
// All health checks must pass for app to be considered ready to accept traffic after starting
114+
app.MapHealthChecks(HealthEndpointPath);
116115

117-
// Only health checks tagged with the "live" tag must pass for app to be considered alive
118-
app.MapHealthChecks(AlivenessEndpointPath, new HealthCheckOptions
119-
{
120-
Predicate = r => r.Tags.Contains("live")
121-
});
122-
}
116+
// Only health checks tagged with the "live" tag must pass for app to be considered alive
117+
app.MapHealthChecks(AlivenessEndpointPath, new HealthCheckOptions
118+
{
119+
Predicate = r => r.Tags.Contains("live")
120+
});
123121

124122
return app;
125123
}
126-
}
124+
}

src/modules/apis/AStar.Web.ApiService/Program.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@
3636

3737
app.MapGet("/weatherforecast", () =>
3838
{
39-
var forecast = Enumerable.Range(1, 5).Select(index =>
40-
new WeatherForecast
41-
(
42-
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
43-
Random.Shared.Next(-20, 55),
44-
summaries[Random.Shared.Next(summaries.Length)]
45-
))
39+
var forecast = Enumerable.Range(1, 5).Select(index => new WeatherForecast
40+
(
41+
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
42+
Random.Shared.Next(-20, 55),
43+
summaries[Random.Shared.Next(summaries.Length)]
44+
))
4645
.ToArray();
4746
return forecast;
4847
})
@@ -55,4 +54,4 @@
5554
internal record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
5655
{
5756
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
58-
}
57+
}

src/uis/AStar.Dev.Web/AStar.Dev.Web.csproj

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@
55
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
66
<UserSecretsId>d7e61e34-084f-4c2b-9be8-5925170dc3b7</UserSecretsId>
77
</PropertyGroup>
8-
8+
99
<ItemGroup>
10-
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.4.0" />
11-
<PackageReference Include="FluentUI.Demo.Shared" Version="4.10.4" />
12-
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
13-
<PackageReference Include="Markdig" Version="0.43.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.0" />
15-
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.23.0" />
16-
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.23.0" />
17-
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0" />
18-
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.13.1" />
19-
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.13.1" />
20-
<PackageReference Include="Microsoft.Identity.Web" Version="4.0.1" />
21-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="4.0.1" />
22-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
23-
<PackageReference Include="Scalar.AspNetCore" Version="2.10.3" />
24-
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.16" />
25-
<PackageReference Include="Testably.Abstractions.FileSystem.Interface" Version="10.0.0" />
26-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
27-
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.2.0" />
28-
<PackageReference Include="AStar.Dev.Source.Generators" Version="0.2.6-alpha" />
10+
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.4.0"/>
11+
<PackageReference Include="FluentUI.Demo.Shared" Version="4.10.4"/>
12+
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2"/>
13+
<PackageReference Include="Markdig" Version="0.43.0"/>
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.0"/>
15+
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.23.0"/>
16+
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.23.0"/>
17+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0"/>
18+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.13.1"/>
19+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.13.1"/>
20+
<PackageReference Include="Microsoft.Identity.Web" Version="4.0.1"/>
21+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="4.0.1"/>
22+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0"/>
23+
<PackageReference Include="Scalar.AspNetCore" Version="2.10.3"/>
24+
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.16"/>
25+
<PackageReference Include="Testably.Abstractions.FileSystem.Interface" Version="10.0.0"/>
26+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0"/>
27+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.2.0"/>
28+
<PackageReference Include="AStar.Dev.Source.Generators" Version="0.2.6-alpha"/>
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<Folder Include="wwwroot\assets\" />
32+
<Folder Include="wwwroot\assets\"/>
3333
</ItemGroup>
3434

3535
<ItemGroup>
3636
<ProjectReference Include="..\..\aspire\AStar.Web.ServiceDefaults\AStar.Web.ServiceDefaults.csproj"/>
3737
</ItemGroup>
3838

3939
<ItemGroup>
40-
<Using Include="JetBrains.Annotations" />
40+
<Using Include="JetBrains.Annotations"/>
4141
</ItemGroup>
4242

4343
</Project>

src/uis/AStar.Dev.Web/Components/Layout/NavMenu.razor

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@using Microsoft.AspNetCore.Authorization
2-
@using Microsoft.FluentUI.AspNetCore.Components.Icons.Regular
3-
1+
@using Microsoft.FluentUI.AspNetCore.Components.Icons.Regular
42
<div class="navmenu">
53
<input type="checkbox" title="Menu expand/collapse toggle" id="navmenu-toggle" class="navmenu-icon"/>
64
<label for="navmenu-toggle" class="navmenu-icon">
@@ -11,7 +9,8 @@
119
<FluentNavLink Href="/" Match="NavLinkMatch.All" Icon="@(new Size20.Home())" IconColor="Color.Accent">Home</FluentNavLink>
1210
<FluentNavLink Href="counter" Icon="@(new Size20.NumberSymbolSquare())" IconColor="Color.Accent" Tooltip="The OOTB Counter page">Counter</FluentNavLink>
1311
<FluentNavLink Href="weather" Icon="@(new Size20.WeatherPartlyCloudyDay())" IconColor="Color.Accent" Tooltip="The OOTB Weather page">Weather</FluentNavLink>
14-
<FluentNavLink Href="nuget-documentation" Icon="@(new Size20.Document())" IconColor="Color.Accent" Tooltip="Access the NuGet documentation root document">NuGet Documentation</FluentNavLink>
12+
<FluentNavLink Href="nuget-documentation" Icon="@(new Size20.Document())" IconColor="Color.Accent" Tooltip="Access the NuGet documentation root document">NuGet Documentation
13+
</FluentNavLink>
1514
<FluentNavLink Href="kids-games" Icon="@(new Size20.Games())" IconColor="Color.Accent" Tooltip="Play some games (not operational)">Kids Games</FluentNavLink>
1615

1716
@if (!_isAuthenticated)
@@ -48,7 +47,9 @@
4847
</FluentNavLink>
4948
</ChildContent>
5049
</FluentNavGroup>
51-
<FluentNavLink Href="/images/duplicate-images" Icon="@(new Size20.People())" IconColor="Color.Accent" Tooltip="View Duplicate Images based on configurable parameteres" >Duplicate Images</FluentNavLink>
50+
<FluentNavLink Href="/images/duplicate-images" Icon="@(new Size20.People())" IconColor="Color.Accent" Tooltip="View Duplicate Images based on configurable parameteres">Duplicate
51+
Images
52+
</FluentNavLink>
5253
<FluentNavLink Href="MicrosoftIdentity/Account/SignOut" Icon="@(new Size20.SignOut())" IconColor="Color.Accent" Tooltip="Sign out of the site">Sign out, @_firstName</FluentNavLink>
5354
}
5455
</FluentNavMenu>

src/uis/AStar.Dev.Web/Components/Layout/NavMenu.razor.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ namespace AStar.Dev.Web.Components.Layout;
66

77
public partial class NavMenu : ComponentBase
88
{
9-
private bool _expanded = true;
9+
private bool _expanded = true;
1010
private string? _firstName;
11-
private bool _isAuthenticated;
11+
private bool _isAuthenticated;
1212

13-
[CascadingParameter]
14-
private Task<AuthenticationState> AuthenticationStateTask { get; set; } = null!;
13+
[CascadingParameter] private Task<AuthenticationState> AuthenticationStateTask { get; set; } = null!;
1514

1615
protected override async Task OnParametersSetAsync()
1716
{
18-
AuthenticationState authState = await AuthenticationStateTask;
19-
ClaimsPrincipal user = authState.User;
17+
var authState = await AuthenticationStateTask;
18+
var user = authState.User;
2019
_isAuthenticated = user.Identity?.IsAuthenticated ?? false;
2120
_firstName = _isAuthenticated ? ExtractFirstName(user) : null;
2221
}
@@ -35,8 +34,8 @@ var value when value.Contains(' ') => value.AsSpan()[..value.IndexOf(' ')].ToStr
3534

3635
private static string GetNameClaim(ClaimsPrincipal user, string[] claimTypes)
3736
=> claimTypes
38-
.Select(user.FindFirst)
39-
.FirstOrDefault(c => !string.IsNullOrWhiteSpace(c?.Value))?.Value
37+
.Select(user.FindFirst)
38+
.FirstOrDefault(c => !string.IsNullOrWhiteSpace(c?.Value))?.Value
4039
?? IdentityNameOrDefault(user);
4140

4241
private static string IdentityNameOrDefault(ClaimsPrincipal user) => user.Identity?.Name ?? "User";

src/uis/AStar.Dev.Web/Components/Layout/SettingsPanel.razor.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ public partial class SettingsPanel : ComponentBase
88
{
99
private OfficeColor _officeColor = OfficeColor.Office;
1010

11-
[Inject]
12-
public required ILogger<SettingsPanel> Logger { get; set; }
11+
[Inject] public required ILogger<SettingsPanel> Logger { get; set; }
1312

14-
[Inject]
15-
public required IJSRuntime JsRuntime { get; set; }
13+
[Inject] public required IJSRuntime JsRuntime { get; set; }
1614

17-
[Parameter]
18-
public bool IsOpen { get; set; }
15+
[Parameter] public bool IsOpen { get; set; }
1916

20-
[Parameter]
21-
public EventCallback OnClose { get; set; }
17+
[Parameter] public EventCallback OnClose { get; set; }
2218

2319
public required DesignThemeModes Mode { get; set; }
2420

@@ -27,7 +23,7 @@ private OfficeColor OfficeColor
2723
get => _officeColor;
2824
set
2925
{
30-
if(_officeColor != value)
26+
if (_officeColor != value)
3127
{
3228
_officeColor = value;
3329
_ = SaveOfficeColorToStorage();
@@ -44,13 +40,13 @@ private async Task LoadOfficeColorFromStorage()
4440
{
4541
var storedColor = await JsRuntime.InvokeAsync<string>("localStorage.getItem", "officeColor");
4642

47-
if(!string.IsNullOrEmpty(storedColor) && Enum.TryParse<OfficeColor>(storedColor, out OfficeColor parsedColor))
43+
if (!string.IsNullOrEmpty(storedColor) && Enum.TryParse(storedColor, out OfficeColor parsedColor))
4844
{
4945
_officeColor = parsedColor;
5046
StateHasChanged();
5147
}
5248
}
53-
catch(Exception ex)
49+
catch (Exception ex)
5450
{
5551
Logger.LogError(ex, "Error loading OfficeColor from storage");
5652
}
@@ -62,7 +58,7 @@ private async Task SaveOfficeColorToStorage()
6258
{
6359
await JsRuntime.InvokeVoidAsync("localStorage.setItem", "officeColor", OfficeColor.ToString());
6460
}
65-
catch(Exception ex)
61+
catch (Exception ex)
6662
{
6763
Logger.LogError(ex, "Error saving OfficeColor to storage");
6864
}

0 commit comments

Comments
 (0)