Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions src/Elastic.ApiExplorer/Schema/SchemaHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,35 @@
/// <summary>
/// Types that are known to be value types (resolve to primitives like string).
/// </summary>
public static readonly HashSet<string> KnownValueTypes =
[
with(StringComparer.OrdinalIgnoreCase),
public static readonly HashSet<string> KnownValueTypes = new(StringComparer.OrdinalIgnoreCase)

Check failure on line 22 in src/Elastic.ApiExplorer/Schema/SchemaHelpers.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified
{
"Field", "Fields", "Id", "Ids", "IndexName", "Indices", "Name", "Names",
"Routing", "VersionNumber", "SequenceNumber", "PropertyName", "RelationName",
"TaskId", "ScrollId", "SuggestionName", "Duration", "DateMath", "Fuzziness",
"GeoHashPrecision", "Distance", "TimeOfDay", "MinimumShouldMatch", "Script",
"ByteSize", "Percentage", "Stringifiedboolean", "ExpandWildcards", "float", "Stringifiedinteger",
// Numeric value types
"uint", "ulong", "long", "int", "short", "ushort", "byte", "sbyte", "double", "decimal"
];
};

/// <summary>
/// Types that have dedicated pages we can link to.
/// Only container types get their own pages - individual queries/aggregations are rendered inline.
/// </summary>
public static readonly HashSet<string> LinkedTypes =
[
with(StringComparer.OrdinalIgnoreCase),
public static readonly HashSet<string> LinkedTypes = new(StringComparer.OrdinalIgnoreCase)

Check failure on line 37 in src/Elastic.ApiExplorer/Schema/SchemaHelpers.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified
{
"QueryContainer", "AggregationContainer", "Aggregate"
];
};

/// <summary>
/// Primitive/generic type names that are not named schema types.
/// These should not be considered for recursive type detection since they
/// represent generic types rather than specific schema references.
/// </summary>
public static readonly HashSet<string> PrimitiveTypeNames =
[
with(StringComparer.OrdinalIgnoreCase),
public static readonly HashSet<string> PrimitiveTypeNames = new(StringComparer.OrdinalIgnoreCase)

Check failure on line 47 in src/Elastic.ApiExplorer/Schema/SchemaHelpers.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified
{
"boolean", "number", "string", "integer", "object", "null", "array"
];
};

/// <summary>
/// Gets the URL for a container type's dedicated page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@

public HashSet<Product> Products { get; private set; } = [];

private readonly Dictionary<string, string> _substitutions = [with(StringComparer.OrdinalIgnoreCase)];
private readonly Dictionary<string, string> _substitutions = new(StringComparer.OrdinalIgnoreCase);

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 50 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)
public IReadOnlyDictionary<string, string> Substitutions => _substitutions;

private readonly Dictionary<string, bool> _features = [with(StringComparer.OrdinalIgnoreCase)];
private readonly Dictionary<string, bool> _features = new(StringComparer.OrdinalIgnoreCase);

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 53 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

[field: AllowNull, MaybeNull]
public FeatureFlags Features => field ??= new FeatureFlags(_features);
Expand Down Expand Up @@ -259,7 +259,7 @@
Branding = ValidateBranding(docSetFile.Branding, context);

// Process features
_features = [with(StringComparer.OrdinalIgnoreCase)];
_features = new(StringComparer.OrdinalIgnoreCase);

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 262 in src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)
if (docSetFile.Features.PrimaryNav.HasValue)
_features["primary-nav"] = docSetFile.Features.PrimaryNav.Value;
if (docSetFile.Features.DisableGithubEditLink.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class FeatureFlags(Dictionary<string, bool> initFeatureFlags)
{
private readonly Dictionary<string, bool> _featureFlags = [with(initFeatureFlags)];
private readonly Dictionary<string, bool> _featureFlags = new(initFeatureFlags);

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 9 in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

public void Set(string key, bool value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@
Dictionary<string, BundlePerProductRule>? byProduct = null;
if (yaml.Products is { Count: > 0 })
{
byProduct = [with(StringComparer.OrdinalIgnoreCase)];
byProduct = new(StringComparer.OrdinalIgnoreCase);

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 751 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)
foreach (var (productKey, productYaml) in yaml.Products)
{
var productIds = productKey.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
Expand Down Expand Up @@ -946,7 +946,7 @@
Dictionary<string, CreateRules>? byProduct = null;
if (yaml.Products is { Count: > 0 })
{
byProduct = [with(StringComparer.OrdinalIgnoreCase)];
byProduct = new(StringComparer.OrdinalIgnoreCase);

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 949 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)
foreach (var (productKey, productYaml) in yaml.Products)
{
var productIds = productKey.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
Expand Down Expand Up @@ -1011,7 +1011,7 @@
Dictionary<string, PublishBlocker>? byProduct = null;
if (yaml.Products is { Count: > 0 })
{
byProduct = [with(StringComparer.OrdinalIgnoreCase)];
byProduct = new(StringComparer.OrdinalIgnoreCase);

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/opentelemetry)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / integration

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / validate-assembler

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/oblt-actions)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/docs-content)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (elastic/elasticsearch)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / synthetics

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check failure on line 1014 in src/Elastic.Documentation.Configuration/Changelog/ChangelogConfigurationLoader.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Collection initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0028)
foreach (var (productKey, productYaml) in yaml.Products)
{
var productIds = productKey.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
Expand Down
4 changes: 2 additions & 2 deletions src/Elastic.Markdown/IO/MarkdownFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ public virtual string NavigationTitle


//indexed by slug
private readonly Dictionary<string, PageTocItem> _pageTableOfContent = [with(StringComparer.OrdinalIgnoreCase)];
private readonly Dictionary<string, PageTocItem> _pageTableOfContent = new(StringComparer.OrdinalIgnoreCase);
public IReadOnlyDictionary<string, PageTocItem> PageTableOfContent => _pageTableOfContent;

private readonly HashSet<string> _anchors = [with(StringComparer.OrdinalIgnoreCase)];
private readonly HashSet<string> _anchors = new(StringComparer.OrdinalIgnoreCase);
public IReadOnlySet<string> Anchors => _anchors;

public string FilePath { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ public class ChangelogBlock(DirectiveBlockParser parser, ParserContext context)
/// Links to these repositories will be hidden (commented out) in the rendered output.
/// Auto-detected from assembler configuration when available.
/// </summary>
public HashSet<string> PrivateRepositories { get; private set; } = [with(StringComparer.OrdinalIgnoreCase)];
public HashSet<string> PrivateRepositories { get; private set; } = new(StringComparer.OrdinalIgnoreCase);

/// <summary>
/// Feature IDs that should be hidden when rendering changelog entries.
/// Combined from all loaded bundles' hide-features fields.
/// Entries with matching feature-id values will be excluded from the output.
/// </summary>
public HashSet<string> HideFeatures { get; private set; } = [with(StringComparer.OrdinalIgnoreCase)];
public HashSet<string> HideFeatures { get; private set; } = new(StringComparer.OrdinalIgnoreCase);

/// <summary>
/// How to handle PR/issue links relative to private bundle repos (see :link-visibility: option).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// </summary>
public class MockEnvironmentVariables : IEnvironmentVariables
{
private readonly Dictionary<string, string> _variables = [with(StringComparer.OrdinalIgnoreCase)];
private readonly Dictionary<string, string> _variables = new(StringComparer.OrdinalIgnoreCase);

Check warning on line 17 in tests/Elastic.Documentation.Build.Tests/MockEnvironmentVariables.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

Check warning on line 17 in tests/Elastic.Documentation.Build.Tests/MockEnvironmentVariables.cs

View workflow job for this annotation

GitHub Actions / lint

Collection initialization can be simplified

/// <summary>
/// Sets an environment variable value for testing.
Expand Down
Loading