Skip to content

Commit 1663e38

Browse files
authored
Additional cleanup after netstandard drop (#5436)
1 parent f361167 commit 1663e38

26 files changed

Lines changed: 6 additions & 82 deletions

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ jobs:
6969
with:
7070
dotnet-version: |
7171
${{ env.dotnet_sdk_version }}
72-
3.1.x
7372
7473
- name: Build
7574
run: dotnet build -c ${{ matrix.config }}

Directory.Build.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@
1919
<IncludeSymbols>true</IncludeSymbols>
2020
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
22-
<NoWarn>$(NoWarn);NETSDK1138</NoWarn> <!-- The target framework 'net5.0' is out of support -->
2322
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
2423
</PropertyGroup>
2524

26-
<!-- In netstandard2.0, the BCL isn't annotated for nullability so we disable nullability there -->
27-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netcoreapp3.1'">
28-
<Nullable>disable</Nullable>
29-
<NoWarn>$(NoWarn);CS8632;CS8600</NoWarn>
30-
</PropertyGroup>
31-
3225
<ItemGroup>
3326
<None Include="$(MSBuildThisFileDirectory)postgresql.png" Pack="true" PackagePath="" />
3427
</ItemGroup>

Directory.Packages.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@
1010
<PackageVersion Include="OpenTelemetry.API" Version="1.6.0" />
1111

1212
<!-- Compatibility -->
13-
<PackageVersion Include="System.Threading.Channels" Version="$(SystemVersion)" />
14-
<PackageVersion Include="System.Collections.Immutable" Version="$(SystemVersion)" />
1513
<PackageVersion Include="System.Text.Json" Version="$(SystemVersion)" />
1614
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(SystemVersion) " />
17-
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
1815
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
1916

2017
<!-- Plugin projects -->

src/Npgsql/Internal/Converters/JsonConverter.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ public static bool TryReadStream(bool jsonb, Encoding encoding, PgReader reader,
113113

114114
var isUtf8 = encoding.CodePage == Encoding.UTF8.CodePage;
115115
byteCount = reader.CurrentRemaining;
116-
// We always fall back to buffers on older targets
117116
if (isUtf8 || byteCount >= StreamingThreshold)
118117
{
119118
stream = !isUtf8
120-
? Encoding.CreateTranscodingStream(reader.GetStream(), encoding, Encoding.UTF8)
121-
: reader.GetStream();
119+
? Encoding.CreateTranscodingStream(reader.GetStream(), encoding, Encoding.UTF8)
120+
: reader.GetStream();
122121
}
123122
else
124123
stream = null;

src/Npgsql/Internal/HackyEnumTypeMapping.cs

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

99
namespace Npgsql.Internal;
1010

11-
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
1211

1312
/// <summary>
1413
/// Hacky temporary measure used by EFCore.PG to extract user-configured enum mappings. Accessed via reflection only.

src/Npgsql/Internal/NpgsqlConnector.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ Task<IPAddress[]> GetHostAddressesAsync(CancellationToken ct) =>
10351035

10361036
static Task OpenSocketConnectionAsync(Socket socket, EndPoint endpoint, NpgsqlTimeout perIpTimeout, CancellationToken cancellationToken)
10371037
{
1038-
// Whether the framework and/or the OS platform support Socket.ConnectAsync cancellation API or they do not,
1038+
// Whether the OS platform supports Socket.ConnectAsync cancellation API or not,
10391039
// we always fake-cancel the operation with the help of TaskTimeoutAndCancellation.ExecuteAsync. It stops waiting
10401040
// and raises the exception, while the actual task may be left running.
10411041
Task ConnectAsync(CancellationToken ct) =>
@@ -2484,7 +2484,6 @@ internal void EndUserAction()
24842484

24852485
#region Keepalive
24862486

2487-
#pragma warning disable CA1801 // Review unused parameters
24882487
void PerformKeepAlive(object? state)
24892488
{
24902489
Debug.Assert(_isKeepAliveEnabled);
@@ -2523,7 +2522,6 @@ void PerformKeepAlive(object? state)
25232522
Monitor.Exit(SyncObj);
25242523
}
25252524
}
2526-
#pragma warning restore CA1801 // Review unused parameters
25272525

25282526
#endregion
25292527

@@ -2792,9 +2790,7 @@ enum ConnectorState
27922790
Replication,
27932791
}
27942792

2795-
#pragma warning disable CA1717
27962793
enum TransactionStatus : byte
2797-
#pragma warning restore CA1717
27982794
{
27992795
/// <summary>
28002796
/// Currently not in a transaction block

src/Npgsql/Internal/NpgsqlWriteBuffer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using Npgsql.Util;
1111
using static System.Threading.Timeout;
1212

13-
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
1413
namespace Npgsql.Internal;
1514

1615
/// <summary>

src/Npgsql/KerberosUsernameProvider.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ sealed class KerberosUsernameProvider
4444

4545
return GetUsernameAsyncInternal();
4646

47-
#pragma warning disable CS1998
4847
async ValueTask<string?> GetUsernameAsyncInternal()
49-
#pragma warning restore CS1998
5048
{
5149
if (async)
5250
await process.WaitForExitAsync(cancellationToken).ConfigureAwait(false);

src/Npgsql/Npgsql.csproj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,8 @@
2222
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
2323
</ItemGroup>
2424

25-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
26-
<PackageReference Include="Microsoft.Bcl.HashCode" />
27-
</ItemGroup>
28-
29-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' ">
30-
<PackageReference Include="System.Threading.Channels" />
31-
<PackageReference Include="System.Collections.Immutable" />
32-
</ItemGroup>
3325

34-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net6.0' ">
26+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
3527
<PackageReference Include="System.Text.Json" />
3628
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
3729
<PackageReference Include="System.Diagnostics.DiagnosticSource" />

src/Npgsql/NpgsqlBatchCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public override string CommandText
4141
/// <inheritdoc cref="DbBatchCommand.Parameters"/>
4242
public new NpgsqlParameterCollection Parameters => _parameters ??= new();
4343

44-
#pragma warning disable CA1822 // Mark members as static
4544

4645
#if NET8_0_OR_GREATER
4746
/// <inheritdoc/>
@@ -66,7 +65,6 @@ public bool CanCreateParameter
6665
#endif
6766
=> true;
6867

69-
#pragma warning restore CA1822 // Mark members as static
7068

7169
/// <summary>
7270
/// Appends an error barrier after this batch command. Defaults to the value of <see cref="NpgsqlBatch.EnableErrorBarriers" /> on the

0 commit comments

Comments
 (0)