Skip to content

Commit 1f470b6

Browse files
committed
Fixed dotnet-format issues
1 parent d7c791b commit 1f470b6

File tree

11 files changed

+34
-34
lines changed

11 files changed

+34
-34
lines changed

samples/Demo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
options.DefaultMode = NLWebNet.Models.QueryMode.List;
5555
options.EnableStreaming = true;
5656
});
57-
57+
5858
// Add OpenTelemetry for non-Aspire environments (development/testing)
5959
builder.Services.AddNLWebNetOpenTelemetry("NLWebNet.Demo", "1.0.0", otlBuilder =>
6060
{

src/NLWebNet/Endpoints/HealthEndpoints.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,31 @@ private static async Task<IResult> GetBasicHealthAsync(
5858
try
5959
{
6060
var healthReport = await healthCheckService.CheckHealthAsync(cancellationToken);
61-
61+
6262
var response = new HealthCheckResponse
6363
{
6464
Status = healthReport.Status.ToString(),
6565
TotalDuration = healthReport.TotalDuration
6666
};
6767

68-
var statusCode = healthReport.Status == HealthStatus.Healthy
69-
? StatusCodes.Status200OK
68+
var statusCode = healthReport.Status == HealthStatus.Healthy
69+
? StatusCodes.Status200OK
7070
: StatusCodes.Status503ServiceUnavailable;
7171

7272
logger.LogInformation("Health check completed with status: {Status}", healthReport.Status);
73-
73+
7474
return Results.Json(response, statusCode: statusCode);
7575
}
7676
catch (Exception ex)
7777
{
7878
logger.LogError(ex, "Health check failed with exception");
79-
79+
8080
var response = new HealthCheckResponse
8181
{
8282
Status = "Unhealthy",
8383
TotalDuration = TimeSpan.Zero
8484
};
85-
85+
8686
return Results.Json(response, statusCode: StatusCodes.Status503ServiceUnavailable);
8787
}
8888
}
@@ -97,7 +97,7 @@ private static async Task<IResult> GetDetailedHealthAsync(
9797
try
9898
{
9999
var healthReport = await healthCheckService.CheckHealthAsync(cancellationToken);
100-
100+
101101
var response = new DetailedHealthCheckResponse
102102
{
103103
Status = healthReport.Status.ToString(),
@@ -114,19 +114,19 @@ private static async Task<IResult> GetDetailedHealthAsync(
114114
})
115115
};
116116

117-
var statusCode = healthReport.Status == HealthStatus.Healthy
118-
? StatusCodes.Status200OK
117+
var statusCode = healthReport.Status == HealthStatus.Healthy
118+
? StatusCodes.Status200OK
119119
: StatusCodes.Status503ServiceUnavailable;
120120

121-
logger.LogInformation("Detailed health check completed with status: {Status}, Entries: {EntryCount}",
121+
logger.LogInformation("Detailed health check completed with status: {Status}, Entries: {EntryCount}",
122122
healthReport.Status, healthReport.Entries.Count);
123-
123+
124124
return Results.Json(response, statusCode: statusCode);
125125
}
126126
catch (Exception ex)
127127
{
128128
logger.LogError(ex, "Detailed health check failed with exception");
129-
129+
130130
var response = new DetailedHealthCheckResponse
131131
{
132132
Status = "Unhealthy",
@@ -142,7 +142,7 @@ private static async Task<IResult> GetDetailedHealthAsync(
142142
}
143143
}
144144
};
145-
145+
146146
return Results.Json(response, statusCode: StatusCodes.Status503ServiceUnavailable);
147147
}
148148
}

src/NLWebNet/Extensions/OpenTelemetryExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static IServiceCollection AddNLWebNetOpenTelemetry(
3737
new KeyValuePair<string, object>("service.namespace", "nlwebnet"),
3838
new KeyValuePair<string, object>("service.instance.id", Environment.MachineName)
3939
}));
40-
40+
4141
// Apply additional configuration if provided
4242
configure?.Invoke(builder);
4343
});
@@ -68,7 +68,7 @@ public static IServiceCollection AddNLWebNetOpenTelemetry(
6868
.AddMeter(NLWebMetrics.MeterName)
6969
.AddMeter("Microsoft.AspNetCore.Hosting")
7070
.AddMeter("Microsoft.AspNetCore.Server.Kestrel"));
71-
// .AddRuntimeInstrumentation() - This requires additional packages
71+
// .AddRuntimeInstrumentation() - This requires additional packages
7272

7373
// Configure tracing
7474
builder.WithTracing(tracing => tracing

src/NLWebNet/Health/AIServiceHealthCheck.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context
3333
// Test basic connectivity by checking available tools
3434
// This is a lightweight operation that validates the service is operational
3535
var toolsResult = await _mcpService.ListToolsAsync(cancellationToken);
36-
36+
3737
if (toolsResult == null)
3838
{
3939
return HealthCheckResult.Degraded("AI/MCP service responded but returned null tools list");

src/NLWebNet/Health/DataBackendHealthCheck.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context
3333
// Test basic connectivity by attempting a simple query
3434
// This is a lightweight check that doesn't impact performance
3535
var testResults = await _dataBackend.SearchAsync("health-check", cancellationToken: cancellationToken);
36-
36+
3737
// The search should complete without throwing an exception
3838
// We don't care about the results, just that the backend is responsive
39-
39+
4040
_logger.LogDebug("Data backend health check completed successfully");
4141
return HealthCheckResult.Healthy($"Data backend ({_dataBackend.GetType().Name}) is operational");
4242
}

src/NLWebNet/Health/NLWebHealthCheck.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public NLWebHealthCheck(INLWebService nlWebService, ILogger<NLWebHealthCheck> lo
2222
public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
2323
{
2424
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
25-
25+
2626
try
2727
{
2828
// Check if the service is responsive by testing a simple query
@@ -63,7 +63,7 @@ public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, Canc
6363

6464
private static void RecordHealthCheckMetrics(string checkName, HealthStatus status, double durationMs)
6565
{
66-
NLWebMetrics.HealthCheckExecutions.Add(1,
66+
NLWebMetrics.HealthCheckExecutions.Add(1,
6767
new KeyValuePair<string, object?>(NLWebMetrics.Tags.HealthCheckName, checkName));
6868

6969
if (status != HealthStatus.Healthy)

src/NLWebNet/Middleware/MetricsMiddleware.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task InvokeAsync(HttpContext context)
3131
activity?.SetTag("http.method", method);
3232
activity?.SetTag("http.route", path);
3333
activity?.SetTag("http.scheme", context.Request.Scheme);
34-
34+
3535
// Add correlation ID to activity if present
3636
if (context.Request.Headers.TryGetValue("X-Correlation-ID", out var correlationId))
3737
{
@@ -41,15 +41,15 @@ public async Task InvokeAsync(HttpContext context)
4141
try
4242
{
4343
await _next(context);
44-
44+
4545
// Set success status
4646
activity?.SetTag("http.status_code", context.Response.StatusCode);
4747
activity?.SetStatus(context.Response.StatusCode >= 400 ? ActivityStatusCode.Error : ActivityStatusCode.Ok);
4848
}
4949
catch (Exception ex)
5050
{
5151
// Record error metrics
52-
NLWebMetrics.RequestErrors.Add(1,
52+
NLWebMetrics.RequestErrors.Add(1,
5353
new KeyValuePair<string, object?>(NLWebMetrics.Tags.Endpoint, path),
5454
new KeyValuePair<string, object?>(NLWebMetrics.Tags.Method, method),
5555
new KeyValuePair<string, object?>(NLWebMetrics.Tags.ErrorType, ex.GetType().Name));

src/NLWebNet/Middleware/NLWebMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public async Task InvokeAsync(HttpContext context)
4040

4141
// Log incoming request with structured data
4242
_logger.LogInformation("Processing {Method} {Path} from {RemoteIP} with correlation ID {CorrelationId}",
43-
context.Request.Method, context.Request.Path,
43+
context.Request.Method, context.Request.Path,
4444
context.Connection.RemoteIpAddress?.ToString() ?? "unknown", correlationId);
4545

4646
try

src/NLWebNet/Middleware/RateLimitingMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private string GetClientIdentifier(HttpContext context)
8080
private async Task HandleRateLimitExceeded(HttpContext context, string identifier)
8181
{
8282
var status = await _rateLimitingService.GetRateLimitStatusAsync(identifier);
83-
83+
8484
context.Response.StatusCode = 429; // Too Many Requests
8585
context.Response.Headers.Append("X-RateLimit-Limit", _options.RequestsPerWindow.ToString());
8686
context.Response.Headers.Append("X-RateLimit-Remaining", "0");

tests/NLWebNet.Tests/Extensions/AspireExtensionsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public void AddNLWebNetForAspire_RegistersAllRequiredServices()
2626

2727
// Assert
2828
var serviceProvider = services.BuildServiceProvider();
29-
29+
3030
// Check core NLWebNet services are registered
3131
Assert.IsNotNull(serviceProvider.GetService<INLWebService>());
3232
Assert.IsNotNull(serviceProvider.GetService<IQueryProcessor>());
3333
Assert.IsNotNull(serviceProvider.GetService<IResultGenerator>());
34-
34+
3535
// Check OpenTelemetry services are registered (service discovery may not be directly accessible)
3636
Assert.IsNotNull(serviceProvider.GetService<OpenTelemetry.Metrics.MeterProvider>());
3737
Assert.IsNotNull(serviceProvider.GetService<OpenTelemetry.Trace.TracerProvider>());
@@ -69,10 +69,10 @@ public void AddNLWebNetDefaults_ConfiguresHostBuilder()
6969
// Assert
7070
var app = builder.Build();
7171
var serviceProvider = app.Services;
72-
72+
7373
// Check NLWebNet services are registered
7474
Assert.IsNotNull(serviceProvider.GetService<INLWebService>());
75-
75+
7676
// Check OpenTelemetry services are registered
7777
Assert.IsNotNull(serviceProvider.GetService<OpenTelemetry.Metrics.MeterProvider>());
7878
Assert.IsNotNull(serviceProvider.GetService<OpenTelemetry.Trace.TracerProvider>());

0 commit comments

Comments
 (0)