Skip to content
Open
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true

# Help Link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1852
# Tags : Telemetry, EnabledRuleInAggressiveMode, CompilationEnd
dotnet_diagnostic.CA1852.severity = warning

# IDE preferences
dotnet_diagnostic.IDE0090.severity = silent # IDE0090: Use 'new(...)'
Expand Down
2 changes: 1 addition & 1 deletion tests/BasicTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public CustomConfig()
AddJob(Configure(Job.Default.WithRuntime(CoreRuntime.Core50)));
}
}
internal class SlowConfig : CustomConfig
internal sealed class SlowConfig : CustomConfig
{
protected override Job Configure(Job j)
=> j.WithLaunchCount(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/StackExchange.Redis.Benchmarks/SlowConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace StackExchange.Redis.Benchmarks
{
internal class SlowConfig : CustomConfig
internal sealed class SlowConfig : CustomConfig
{
protected override Job Configure(Job j)
=> j.WithLaunchCount(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/StackExchange.Redis.Tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public void HttpTunnelCanRoundtrip(string input, string expected)
Assert.Equal($"127.0.0.1:6380,tunnel={expected}", cs);
}

private class CustomTunnel : Tunnel { }
private sealed class CustomTunnel : Tunnel { }

[Fact]
public void CustomTunnelCanRoundtripMinusTunnel()
Expand Down
4 changes: 2 additions & 2 deletions tests/StackExchange.Redis.Tests/LoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
/// <summary>
/// To save on test time, no reason to spin up n connections just to test n logging implementations...
/// </summary>
private class TestMultiLogger(params ILogger[] loggers) : ILogger
private sealed class TestMultiLogger(params ILogger[] loggers) : ILogger
{
#if NET8_0_OR_GREATER
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
Expand All @@ -95,7 +95,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
}
}

private class TestLogger : ILogger
private sealed class TestLogger : ILogger
{
private readonly StringBuilder sb = new StringBuilder();
private long _callCount;
Expand Down
2 changes: 1 addition & 1 deletion tests/StackExchange.Redis.Tests/ParseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void ProcessMessages(Arena<RawResult> arena, ReadOnlySequence<byte> buff
Assert.Equal(expected, found);
}

private class FragmentedSegment<T> : ReadOnlySequenceSegment<T>
private sealed class FragmentedSegment<T> : ReadOnlySequenceSegment<T>
{
public FragmentedSegment(long runningIndex, ReadOnlyMemory<T> memory)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/StackExchange.Redis.Tests/ProfilingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ public async Task ManyContexts()
}
}

internal class PerThreadProfiler
internal sealed class PerThreadProfiler
{
private readonly ThreadLocal<ProfilingSession> perThreadSession = new ThreadLocal<ProfilingSession>(() => new ProfilingSession());

public ProfilingSession GetSession() => perThreadSession.Value!;
}

internal class AsyncLocalProfiler
internal sealed class AsyncLocalProfiler
{
private readonly AsyncLocal<ProfilingSession> perThreadSession = new AsyncLocal<ProfilingSession>();

Expand Down
Loading