Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pr/2769
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCraver committed Aug 18, 2024
2 parents 173dfa7 + 3701b50 commit 8c40850
Show file tree
Hide file tree
Showing 224 changed files with 3,404 additions and 4,193 deletions.
78 changes: 64 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,73 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true

# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = silent

# RCS1037: Remove trailing white-space.
dotnet_diagnostic.RCS1037.severity = error
# IDE preferences
dotnet_diagnostic.IDE0090.severity = silent # IDE0090: Use 'new(...)'

#Roslynator preferences
dotnet_diagnostic.RCS1037.severity = error # RCS1037: Remove trailing white-space.
dotnet_diagnostic.RCS1098.severity = none # RCS1098: Constant values should be placed on right side of comparisons.

dotnet_diagnostic.RCS1194.severity = none # RCS1194: Implement exception constructors.
dotnet_diagnostic.RCS1229.severity = none # RCS1229: Use async/await when necessary.
dotnet_diagnostic.RCS1233.severity = none # RCS1233: Use short-circuiting operator.
dotnet_diagnostic.RCS1234.severity = none # RCS1234: Duplicate enum value.

# StyleCop preferences
dotnet_diagnostic.SA0001.severity = none # SA0001: XML comment analysis is disabled

dotnet_diagnostic.SA1101.severity = none # SA1101: Prefix local calls with this
dotnet_diagnostic.SA1108.severity = none # SA1108: Block statements should not contain embedded comments
dotnet_diagnostic.SA1122.severity = none # SA1122: Use string.Empty for empty strings
dotnet_diagnostic.SA1127.severity = none # SA1127: Generic type constraints should be on their own line
dotnet_diagnostic.SA1128.severity = none # SA1128: Put constructor initializers on their own line
dotnet_diagnostic.SA1132.severity = none # SA1132: Do not combine fields
dotnet_diagnostic.SA1133.severity = none # SA1133: Do not combine attributes

dotnet_diagnostic.SA1200.severity = none # SA1200: Using directives should be placed correctly
dotnet_diagnostic.SA1201.severity = none # SA1201: Elements should appear in the correct order
dotnet_diagnostic.SA1202.severity = none # SA1202: Elements should be ordered by access
dotnet_diagnostic.SA1203.severity = none # SA1203: Constants should appear before fields

dotnet_diagnostic.SA1306.severity = none # SA1306: Field names should begin with lower-case letter
dotnet_diagnostic.SA1309.severity = none # SA1309: Field names should not begin with underscore
dotnet_diagnostic.SA1310.severity = silent # SA1310: Field names should not contain underscore
dotnet_diagnostic.SA1311.severity = none # SA1311: Static readonly fields should begin with upper-case letter
dotnet_diagnostic.SA1312.severity = none # SA1312: Variable names should begin with lower-case letter

dotnet_diagnostic.SA1401.severity = silent # SA1401: Fields should be private
dotnet_diagnostic.SA1402.severity = suggestion # SA1402: File may only contain a single type

dotnet_diagnostic.SA1503.severity = silent # SA1503: Braces should not be omitted
dotnet_diagnostic.SA1516.severity = silent # SA1516: Elements should be separated by blank line

dotnet_diagnostic.SA1600.severity = none # SA1600: Elements should be documented
dotnet_diagnostic.SA1601.severity = none # SA1601: Partial elements should be documented
dotnet_diagnostic.SA1602.severity = none # SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1615.severity = none # SA1615: Element return value should be documented
dotnet_diagnostic.SA1623.severity = none # SA1623: Property summary documentation should match accessors
dotnet_diagnostic.SA1633.severity = none # SA1633: File should have header
dotnet_diagnostic.SA1642.severity = none # SA1642: Constructor summary documentation should begin with standard text
dotnet_diagnostic.SA1643.severity = none # SA1643: Destructor summary documentation should begin with standard text


# To Fix:
dotnet_diagnostic.SA1204.severity = none # SA1204: Static elements should appear before instance elements
dotnet_diagnostic.SA1214.severity = none # SA1214: Readonly fields should appear before non-readonly fields
dotnet_diagnostic.SA1304.severity = none # SA1304: Non-private readonly fields should begin with upper-case letter
dotnet_diagnostic.SA1307.severity = none # SA1307: Accessible fields should begin with upper-case letter
dotnet_diagnostic.SA1308.severity = suggestion # SA1308: Variable names should not be prefixed
dotnet_diagnostic.SA1131.severity = none # SA1131: Use readable conditions
dotnet_diagnostic.SA1405.severity = none # SA1405: Debug.Assert should provide message text
dotnet_diagnostic.SA1501.severity = none # SA1501: Statement should not be on a single line
dotnet_diagnostic.SA1502.severity = suggestion # SA1502: Element should not be on a single line
dotnet_diagnostic.SA1513.severity = none # SA1513: Closing brace should be followed by blank line
dotnet_diagnostic.SA1515.severity = none # SA1515: Single-line comment should be preceded by blank line
dotnet_diagnostic.SA1611.severity = suggestion # SA1611: Element parameters should be documented
dotnet_diagnostic.SA1649.severity = suggestion # SA1649: File name should match first type name

# RCS1098: Constant values should be placed on right side of comparisons.
dotnet_diagnostic.RCS1098.severity = none

# RCS1194: Implement exception constructors.
dotnet_diagnostic.RCS1194.severity = none

# RCS1229: Use async/await when necessary.
dotnet_diagnostic.RCS1229.severity = none

# RCS1233: Use short-circuiting operator.
dotnet_diagnostic.RCS1233.severity = none

# RCS1234: Duplicate enum value.
dotnet_diagnostic.RCS1234.severity = none
11 changes: 8 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: .NET Build
run: dotnet build Build.csproj -c Release /p:CI=true
- name: Start Redis Services (docker-compose)
working-directory: ./tests/RedisConfigs
run: docker-compose -f docker-compose.yml up -d
run: docker compose -f docker-compose.yml up -d --wait
- name: StackExchange.Redis.Tests
run: dotnet test tests/StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj -c Release --logger trx --logger GitHubActions --results-directory ./test-results/ /p:CI=true
- uses: dorny/test-reporter@v1
Expand All @@ -49,6 +49,7 @@ jobs:
NUGET_CERT_REVOCATION_MODE: offline # Disabling signing because of massive perf hit, see https://github.com/NuGet/Home/issues/11548
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: "1" # Note this doesn't work yet for Windows - see https://github.com/dotnet/runtime/issues/68340
TERM: xterm
DOCKER_BUILDKIT: 1
steps:
- name: Checkout code
uses: actions/checkout@v1
Expand All @@ -57,9 +58,13 @@ jobs:
# with:
# dotnet-version: |
# 6.0.x
# 7.0.x
# 8.0.x
- name: .NET Build
run: dotnet build Build.csproj -c Release /p:CI=true
# We can't do this combination - see https://github.com/actions/runner/issues/904
# - name: Start Redis Services (docker-compose)
# working-directory: .\tests\RedisConfigs
# run: docker compose -f docker-compose.yml up -d --wait
- name: Start Redis Services (v3.0.503)
working-directory: .\tests\RedisConfigs\3.0.503
run: |
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release' and '$(SourceRoot)'==''">
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
</ItemGroup>
</Project>
17 changes: 9 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@

<!-- Packages only used in the solution, upgrade at will -->
<PackageVersion Include="BenchmarkDotNet" Version="0.13.1" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.0.0-alpha" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.4.255" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="NSubstitute" Version="5.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.141" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.6.96" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<!-- For binding redirect testing, main package gets this transitively -->
<PackageVersion Include="System.IO.Pipelines" Version="5.0.1" />
<PackageVersion Include="System.Runtime.Caching" Version="5.0.0" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Current package versions:

## Unreleased

- Add support for hash field expiration (see [#2715](https://github.com/StackExchange/StackExchange.Redis/issues/2715)) ([#2716 by atakavci](https://github.com/StackExchange/StackExchange.Redis/pull/2716]))

## 2.8.0

Expand Down
8 changes: 4 additions & 4 deletions src/StackExchange.Redis/APITypes/ClientKillFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public ClientKillFilter WithSkipMe(bool? skipMe)
/// <summary>
/// Set the MaxAgeInSeconds filter.
/// </summary>
/// <param name="maxAgeInSeconds">Age of connection in seconds</param>
/// <param name="maxAgeInSeconds">Age of connection in seconds.</param>
public ClientKillFilter WithMaxAgeInSeconds(long? maxAgeInSeconds)
{
MaxAgeInSeconds = maxAgeInSeconds;
Expand All @@ -123,9 +123,9 @@ public ClientKillFilter WithMaxAgeInSeconds(long? maxAgeInSeconds)
internal List<RedisValue> ToList(bool withReplicaCommands)
{
var parts = new List<RedisValue>(15)
{
RedisLiterals.KILL
};
{
RedisLiterals.KILL,
};
if (Id != null)
{
parts.Add(RedisLiterals.ID);
Expand Down
6 changes: 5 additions & 1 deletion src/StackExchange.Redis/APITypes/GeoRadiusOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@ public enum GeoRadiusOptions
/// No Options.
/// </summary>
None = 0,

/// <summary>
/// Redis will return the coordinates of any results.
/// </summary>
WithCoordinates = 1,

/// <summary>
/// Redis will return the distance from center for all results.
/// </summary>
WithDistance = 2,

/// <summary>
/// Redis will return the geo hash value as an integer. (This is the score in the sorted set).
/// </summary>
WithGeoHash = 4,

/// <summary>
/// Populates the commonly used values from the entry (the integer hash is not returned as it is not commonly useful).
/// </summary>
Default = WithCoordinates | WithDistance
Default = WithCoordinates | WithDistance,
}

internal static class GeoRadiusOptionsExtensions
Expand Down
2 changes: 1 addition & 1 deletion src/StackExchange.Redis/APITypes/GeoRadiusResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public readonly struct GeoRadiusResult
/// <summary>
/// The hash value of the matched member as an integer. (The key in the sorted set).
/// </summary>
/// <remarks>Note that this is not the same as the hash returned from GeoHash</remarks>
/// <remarks>Note that this is not the same as the hash returned from GeoHash.</remarks>
public long? Hash { get; }

/// <summary>
Expand Down
15 changes: 7 additions & 8 deletions src/StackExchange.Redis/APITypes/GeoSearchShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace StackExchange.Redis;

/// <summary>
/// A Shape that you can use for a GeoSearch
/// A Shape that you can use for a GeoSearch.
/// </summary>
public abstract class GeoSearchShape
{
Expand All @@ -18,9 +18,9 @@ public abstract class GeoSearchShape
internal abstract int ArgCount { get; }

/// <summary>
/// constructs a <see cref="GeoSearchShape"/>
/// constructs a <see cref="GeoSearchShape"/>.
/// </summary>
/// <param name="unit"></param>
/// <param name="unit">The geography unit to use.</param>
public GeoSearchShape(GeoUnit unit)
{
Unit = unit;
Expand All @@ -30,7 +30,7 @@ public GeoSearchShape(GeoUnit unit)
}

/// <summary>
/// A circle drawn on a map bounding
/// A circle drawn on a map bounding.
/// </summary>
public class GeoSearchCircle : GeoSearchShape
{
Expand All @@ -41,17 +41,16 @@ public class GeoSearchCircle : GeoSearchShape
/// </summary>
/// <param name="radius">The radius of the circle.</param>
/// <param name="unit">The distance unit the circle will use, defaults to Meters.</param>
public GeoSearchCircle(double radius, GeoUnit unit = GeoUnit.Meters) : base (unit)
public GeoSearchCircle(double radius, GeoUnit unit = GeoUnit.Meters) : base(unit)
{
_radius = radius;
}

internal override int ArgCount => 3;

/// <summary>
/// Gets the <exception cref="RedisValue"/>s for this shape
/// Gets the <see cref="RedisValue"/>s for this shape.
/// </summary>
/// <returns></returns>
internal override void AddArgs(List<RedisValue> args)
{
args.Add(RedisLiterals.BYRADIUS);
Expand All @@ -61,7 +60,7 @@ internal override void AddArgs(List<RedisValue> args)
}

/// <summary>
/// A box drawn on a map
/// A box drawn on a map.
/// </summary>
public class GeoSearchBox : GeoSearchShape
{
Expand Down
6 changes: 3 additions & 3 deletions src/StackExchange.Redis/APITypes/LatencyHistoryEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace StackExchange.Redis;

/// <summary>
/// A latency entry as reported by the built-in LATENCY HISTORY command
/// A latency entry as reported by the built-in LATENCY HISTORY command.
/// </summary>
public readonly struct LatencyHistoryEntry
{
Expand All @@ -30,12 +30,12 @@ protected override bool TryParse(in RawResult raw, out LatencyHistoryEntry parse
}

/// <summary>
/// The time at which this entry was recorded
/// The time at which this entry was recorded.
/// </summary>
public DateTime Timestamp { get; }

/// <summary>
/// The latency recorded for this event
/// The latency recorded for this event.
/// </summary>
public int DurationMilliseconds { get; }

Expand Down
10 changes: 5 additions & 5 deletions src/StackExchange.Redis/APITypes/LatencyLatestEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace StackExchange.Redis;

/// <summary>
/// A latency entry as reported by the built-in LATENCY LATEST command
/// A latency entry as reported by the built-in LATENCY LATEST command.
/// </summary>
public readonly struct LatencyLatestEntry
{
Expand Down Expand Up @@ -31,22 +31,22 @@ protected override bool TryParse(in RawResult raw, out LatencyLatestEntry parsed
}

/// <summary>
/// The name of this event
/// The name of this event.
/// </summary>
public string EventName { get; }

/// <summary>
/// The time at which this entry was recorded
/// The time at which this entry was recorded.
/// </summary>
public DateTime Timestamp { get; }

/// <summary>
/// The latency recorded for this event
/// The latency recorded for this event.
/// </summary>
public int DurationMilliseconds { get; }

/// <summary>
/// The max latency recorded for all events
/// The max latency recorded for all events.
/// </summary>
public int MaxDurationMilliseconds { get; }

Expand Down
3 changes: 1 addition & 2 deletions src/StackExchange.Redis/APITypes/StreamPendingMessageInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace StackExchange.Redis;
namespace StackExchange.Redis;

/// <summary>
/// Describes properties of a pending message.
Expand Down
Loading

0 comments on commit 8c40850

Please sign in to comment.