Skip to content

Commit

Permalink
Update dependencies (#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin authored Dec 27, 2024
1 parent b6a59b5 commit 20cee43
Show file tree
Hide file tree
Showing 41 changed files with 118 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
run: dotnet test -c Release --no-build --logger GitHubActions

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
17 changes: 10 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="CommunityToolkit.Diagnostics" Version="8.3.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="DocFx.App" Version="2.77.0" />
<PackageVersion Include="DocFx.App" Version="2.78.2" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.12.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.12.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="MinVer" Version="6.0.0" />
<PackageVersion Include="Scriban" Version="5.10.0" />
<PackageVersion Include="Scriban" Version="5.12.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="ThisAssembly.Resources" Version="1.4.3" />
Expand All @@ -32,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.169" />
<GlobalPackageReference Include="PolySharp" Version="1.14.1" />
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.184" />
<GlobalPackageReference Include="PolySharp" Version="1.15.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Docs/SuperLinq.Docs/SuperLinq.Docs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<NoWarn>$(NoWarn);CA1852;NU1701;NU1902;NU1903</NoWarn>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SuperLinq.Async.Generator;
/// Uses source generation tools to automate the building of some operators
/// </summary>
[Generator]
public sealed class Generator : IIncrementalGenerator
public sealed class IncrementalGenerator : IIncrementalGenerator
{
/// <inheritdoc />
public void Initialize(IncrementalGeneratorInitializationContext context)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>false</IsPackable>
<IsRoslynComponent>true</IsRoslynComponent>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>false</IsPackable>
<IsRoslynComponent>true</IsRoslynComponent>

<!-- Avoid figuring out an actual dependency on Scriban -->
<PackageScribanIncludeSource>true</PackageScribanIncludeSource>
<!-- Analyzer checks-->
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>

<!-- Scriban fails a lot of things in latest-all... -->
<AnalysisLevel>latest-default</AnalysisLevel>

<!-- Analyzer checks-->
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>

<!-- Other things to turn off -->
<NoWarn>$(NoWarn);RS1035;SL03</NoWarn>
<!-- Other things to turn off -->
<NoWarn>$(NoWarn);RS1035</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
<PackageReference Include="Scriban" IncludeAssets="build" />
<PackageReference Include="ThisAssembly.Resources" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
<PackageReference Include="Scriban" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="ThisAssembly.Resources" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<None Remove="*.sbntxt" />
<EmbeddedResource Include="*.sbntxt" Kind="Text" />
</ItemGroup>
<PropertyGroup>
<GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
</PropertyGroup>

<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PkgScriban)/lib/netstandard2.0/Scriban.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>

<ItemGroup>
<Compile Include="../SuperLinq.Generator/ArgumentNames.cs" />
<None Remove="*.sbntxt" />
<EmbeddedResource Include="*.sbntxt" Kind="Text" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="ZipLongest.sbntxt">
<Kind>Text</Kind>
</EmbeddedResource>
<Compile Include="../SuperLinq.Generator/ArgumentNames.cs" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions Generators/SuperLinq.Generator/ArgumentNames.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace SuperLinq.Generator;
namespace SuperLinq.Generator;

/// <summary>
/// int->string translations of different types.
/// </summary>
public record ArgumentNames(string[] Arity, string[] Ordinals, string[] Cardinals)
public record ArgumentNames(IReadOnlyList<string> Arity, IReadOnlyList<string> Ordinals, IReadOnlyList<string> Cardinals)
{
/// <summary>
/// int->string translations of different types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace SuperLinq.Generator;
/// Uses source generation tools to automate the building of some operators
/// </summary>
[Generator]
public sealed class Generator : IIncrementalGenerator
public sealed class IncrementalGenerator : IIncrementalGenerator
{
/// <inheritdoc />
public void Initialize(IncrementalGeneratorInitializationContext context)
Expand Down
44 changes: 24 additions & 20 deletions Generators/SuperLinq.Generator/SuperLinq.Generator.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>false</IsPackable>
<IsRoslynComponent>true</IsRoslynComponent>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>false</IsPackable>
<IsRoslynComponent>true</IsRoslynComponent>

<!-- Avoid figuring out an actual dependency on Scriban -->
<PackageScribanIncludeSource>true</PackageScribanIncludeSource>
<!-- Analyzer checks-->
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>

<!-- Scriban fails a lot of things in latest-all... -->
<AnalysisLevel>latest-default</AnalysisLevel>

<!-- Analyzer checks-->
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>

<!-- Other things to turn off -->
<NoWarn>$(NoWarn);RS1035;SL03</NoWarn>
<!-- Other things to turn off -->
<NoWarn>$(NoWarn);RS1035</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
<PackageReference Include="Scriban" IncludeAssets="build" />
<PackageReference Include="ThisAssembly.Resources" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
<PackageReference Include="Scriban" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="ThisAssembly.Resources" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup>
<GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
</PropertyGroup>

<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PkgScriban)/lib/netstandard2.0/Scriban.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>

<ItemGroup>
<None Remove="*.sbntxt" />
<EmbeddedResource Include="*.sbntxt" Kind="Text" />
<None Remove="*.sbntxt" />
<EmbeddedResource Include="*.sbntxt" Kind="Text" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions Source/SuperLinq.Async/Random.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ private sealed class GlobalRandom : Random
{
private static int s_seed = Environment.TickCount;

[ThreadStatic] private static Random? s_threadRandom;

private static Random ThreadRandom => s_threadRandom ??= new Random(Interlocked.Increment(ref s_seed));
[field: ThreadStatic, System.Diagnostics.CodeAnalysis.MaybeNull]
private static Random ThreadRandom => field ??= new Random(Interlocked.Increment(ref s_seed));

public override int Next() => ThreadRandom.Next();
public override int Next(int minValue, int maxValue) => ThreadRandom.Next(minValue, maxValue);
Expand Down
2 changes: 1 addition & 1 deletion Source/SuperLinq.Async/SuperLinq.Async.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="All" />
<PackageReference Include="Microsoft.Bcl.HashCode" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="MinVer" PrivateAssets="All" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="System.Memory" />
Expand Down
7 changes: 3 additions & 4 deletions Source/SuperLinq/Random.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SuperLinq;
namespace SuperLinq;

public static partial class SuperEnumerable
{
Expand Down Expand Up @@ -215,9 +215,8 @@ private sealed class GlobalRandom : Random
{
private static int s_seed = Environment.TickCount;

[ThreadStatic] private static Random? s_threadRandom;

private static Random ThreadRandom => s_threadRandom ??= new Random(Interlocked.Increment(ref s_seed));
[field: ThreadStatic, System.Diagnostics.CodeAnalysis.MaybeNull]
private static Random ThreadRandom => field ??= new Random(Interlocked.Increment(ref s_seed));

public override int Next() => ThreadRandom.Next();
public override int Next(int minValue, int maxValue) => ThreadRandom.Next(minValue, maxValue);
Expand Down
4 changes: 2 additions & 2 deletions Source/SuperLinq/SuperLinq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="All" />
<PackageReference Include="Microsoft.Bcl.HashCode" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="MinVer" PrivateAssets="All" />
<PackageReference Include="MinVer" PrivateAssets="All" />
<PackageReference Include="System.Memory" />
</ItemGroup>

Expand Down
9 changes: 4 additions & 5 deletions Tests/SuperLinq.Async.Test/MemoizeTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections;
using CommunityToolkit.Diagnostics;

namespace Test.Async;

Expand Down Expand Up @@ -230,10 +229,10 @@ public async Task MemoizeRethrowsErrorDuringIterationToAllsUntilReset()
await using (var r1 = memoized.Read())
await using (var r2 = memoized.Read())
{
Guard.IsTrue(await r1.Read() == await r2.Read());
Assert.True(await r1.Read() == await r2.Read());
_ = await Assert.ThrowsAsync<TestException>(async () => await r1.Read());

Guard.IsTrue(xs.IsDisposed);
Assert.True(xs.IsDisposed);

_ = await Assert.ThrowsAsync<TestException>(async () => await r2.Read());
}
Expand All @@ -259,7 +258,7 @@ public async Task MemoizeRethrowsErrorDuringIterationStartToAllsUntilReset()
await using (var r2 = buffer.Read())
{
_ = await Assert.ThrowsAsync<TestException>(async () => await r1.Read());
Guard.IsTrue(xs.IsDisposed);
Assert.True(xs.IsDisposed);
_ = await Assert.ThrowsAsync<TestException>(async () => await r2.Read());
}

Expand All @@ -269,7 +268,7 @@ public async Task MemoizeRethrowsErrorDuringIterationStartToAllsUntilReset()
Assert.Equal(0, buffer.Count);
await using (var r1 = buffer.Read())
await using (var r2 = buffer.Read())
Guard.IsTrue(await r1.Read() == await r2.Read());
Assert.True(await r1.Read() == await r2.Read());

Assert.Equal(1, buffer.Count);
}
Expand Down
9 changes: 4 additions & 5 deletions Tests/SuperLinq.Async.Test/NullArgumentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#endif
using System.Linq.Expressions;
using System.Reflection;
using CommunityToolkit.Diagnostics;
using Debug = System.Diagnostics.Debug;

namespace Test.Async;
Expand Down Expand Up @@ -241,7 +240,7 @@ public sealed class OrderedEnumerable<T> : Enumerable<T>, IOrderedEnumerable<T>
{
public IOrderedEnumerable<T> CreateOrderedEnumerable<TKey>(Func<T, TKey> keySelector, IComparer<TKey>? comparer, bool descending)
{
Guard.IsNotNull(keySelector);
Assert.NotNull(keySelector);
return this;
}
}
Expand All @@ -262,19 +261,19 @@ public sealed class OrderedAsyncEnumerable<T> : AsyncEnumerable<T>, IOrderedAsyn
{
public IOrderedAsyncEnumerable<T> CreateOrderedEnumerable<TKey>(Func<T, TKey> keySelector, IComparer<TKey>? comparer, bool descending)
{
Guard.IsNotNull(keySelector);
Assert.NotNull(keySelector);
return this;
}

public IOrderedAsyncEnumerable<T> CreateOrderedEnumerable<TKey>(Func<T, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending)
{
Guard.IsNotNull(keySelector);
Assert.NotNull(keySelector);
return this;
}

public IOrderedAsyncEnumerable<T> CreateOrderedEnumerable<TKey>(Func<T, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending)
{
Guard.IsNotNull(keySelector);
Assert.NotNull(keySelector);
return this;
}
}
Expand Down
6 changes: 2 additions & 4 deletions Tests/SuperLinq.Async.Test/PublishTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using CommunityToolkit.Diagnostics;

namespace Test.Async;
namespace Test.Async;

public sealed class PublishTest
{
Expand Down Expand Up @@ -246,7 +244,7 @@ public async Task PublishRethrowsErrorDuringIterationToAllIteratorsUntilReset()

_ = await Assert.ThrowsAsync<TestException>(async () => await r1.Read());
_ = await Assert.ThrowsAsync<TestException>(async () => await r2.Read());
Guard.IsTrue(xs.IsDisposed);
Assert.True(xs.IsDisposed);
}

await using (var r3 = buffer.Read())
Expand Down
7 changes: 3 additions & 4 deletions Tests/SuperLinq.Async.Test/SequenceReader.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System.Diagnostics.CodeAnalysis;
using CommunityToolkit.Diagnostics;

namespace Test.Async;

internal static class SequenceReader
{
public static SequenceReader<T> Read<T>(this IAsyncEnumerable<T> source)
{
Guard.IsNotNull(source);
Assert.NotNull(source);
return new SequenceReader<T>(source);
}
}
Expand Down Expand Up @@ -40,13 +39,13 @@ public SequenceReader(IAsyncEnumerable<T> source) :

public SequenceReader(IAsyncEnumerator<T> enumerator)
{
Guard.IsNotNull(enumerator);
Assert.NotNull(enumerator);
_enumerator = enumerator;
}

private static IAsyncEnumerator<T> GetEnumerator(IAsyncEnumerable<T> source)
{
Guard.IsNotNull(source);
Assert.NotNull(source);
return source.GetAsyncEnumerator();
}

Expand Down
Loading

0 comments on commit 20cee43

Please sign in to comment.