Skip to content

Commit f82eee9

Browse files
authored
Address a bunch of code-analysis quick fixes (#1761)
1 parent 4e484fd commit f82eee9

File tree

85 files changed

+35
-182
lines changed

Some content is hidden

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

85 files changed

+35
-182
lines changed

aspire/AppHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
using ConsoleAppFramework;
77
using Elastic.Documentation;
8-
using Elastic.Documentation.Configuration;
98
using Microsoft.Extensions.Logging;
109
using static Elastic.Documentation.Aspire.ResourceNames;
1110

@@ -29,6 +28,7 @@
2928
return;
3029

3130
// ReSharper disable once RedundantLambdaParameterType
31+
// ReSharper disable once VariableHidesOuterVariable
3232
async Task BuildAspireHost(bool startElasticsearch, bool assumeCloned, bool skipPrivateRepositories, Cancel ctx)
3333
{
3434
var builder = DistributedApplication.CreateBuilder(args);

src/Elastic.ApiExplorer/Endpoints/IndexViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using Elastic.ApiExplorer.Landing;
6-
using Elastic.Documentation;
7-
85
namespace Elastic.ApiExplorer.Endpoints;
96

107
public class IndexViewModel(ApiRenderContext context) : ApiViewModel(context)

src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ private static TRepository RepositoryDefaults<TRepository>(TRepository r, string
9090
};
9191
// ensure we always null path if we are running in CI
9292
if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("CI")))
93-
repository = repository with
94-
{
95-
Path = null
96-
};
93+
repository = repository with { Path = null };
94+
9795
if (string.IsNullOrEmpty(repository.Origin))
9896
{
9997
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_ACTIONS")))
@@ -149,10 +147,8 @@ public ContentSourceMatch Match(string repository, string branchOrTag)
149147
var next = r.GetBranch(ContentSource.Next);
150148
var isVersionBranch = ContentSourceRegex.MatchVersionBranch().IsMatch(branchOrTag);
151149
if (current == branchOrTag)
152-
match = match with
153-
{
154-
Current = ContentSource.Current
155-
};
150+
match = match with { Current = ContentSource.Current };
151+
156152
if (next == branchOrTag)
157153
match = match with
158154
{

src/Elastic.Documentation.Configuration/Assembler/Repository.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Collections;
65
using System.Runtime.Serialization;
76
using YamlDotNet.Serialization;
87

src/Elastic.Documentation.Configuration/ConfigurationFileProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Elastic.Documentation.Configuration.Assembler;
88
using Microsoft.Extensions.DependencyInjection;
99
using NetEscapades.EnumGenerators;
10-
using YamlDotNet.RepresentationModel;
1110

1211
namespace Elastic.Documentation.Configuration;
1312

src/Elastic.Documentation.Configuration/Serialization/YamlStaticContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using Elastic.Documentation.Configuration.Assembler;
66
using Elastic.Documentation.Configuration.Versions;
7-
using YamlDotNet.RepresentationModel;
87
using YamlDotNet.Serialization;
98

109
namespace Elastic.Documentation.Configuration.Serialization;

src/Elastic.Documentation.Configuration/Versions/VersionsConfigurationExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.IO.Abstractions;
65
using Elastic.Documentation.Configuration.Serialization;
76
using YamlDotNet.Serialization;
87
using YamlDotNet.Serialization.NamingConventions;

src/Elastic.Documentation.ServiceDefaults/Extensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Microsoft.Extensions.Hosting;
1010
using Microsoft.Extensions.Logging;
1111
using OpenTelemetry;
12-
using OpenTelemetry.Logs;
1312
using OpenTelemetry.Metrics;
1413
using OpenTelemetry.Trace;
1514

@@ -57,9 +56,9 @@ public static TBuilder ConfigureOpenTelemetry<TBuilder>(this TBuilder builder) w
5756
.WithTracing(tracing =>
5857
{
5958
_ = tracing.AddSource(builder.Environment.ApplicationName)
60-
.AddAspNetCoreInstrumentation(tracing =>
59+
.AddAspNetCoreInstrumentation(instrumentation =>
6160
// Exclude health check requests from tracing
62-
tracing.Filter = context =>
61+
instrumentation.Filter = context =>
6362
!context.Request.Path.StartsWithSegments(HealthEndpointPath)
6463
&& !context.Request.Path.StartsWithSegments(AlivenessEndpointPath)
6564
)

src/Elastic.Documentation.Site/Htmx.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Reflection;
65
using System.Text;
7-
using System.Text.Encodings.Web;
8-
using Elastic.Documentation.Extensions;
96

107
namespace Elastic.Documentation.Site;
118

src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@using Elastic.Documentation.Configuration.Builder
21
@inherits RazorSlice<Elastic.Documentation.Site.GlobalLayoutViewModel>
32
<nav id="secondary-nav" hx-disable="true" class="bg-grey-10 border-t-1 border-grey-20 font-sans font-semibold text-sm text-ink-light md:text-base">
43
<div class="max-w-(--max-layout-width) flex mx-auto justify-between items-center p-6">

0 commit comments

Comments
 (0)