Skip to content

Commit b15c482

Browse files
Bump Roslynator.Analyzers from 4.16.1 to 5.0.0 (#19)
* Bump Roslynator.Analyzers from 4.16.1 to 5.0.0 --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: analyzers ... Signed-off-by: dependabot[bot] <support@github.com> * chore: migrated editorconfig rules to Roslynator.Analyzers 5.0.0 and fixed/suppressed new found violations --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Liebeherr <info@rent-a-developer.de>
1 parent 07e1f66 commit b15c482

17 files changed

Lines changed: 50 additions & 27 deletions

.editorconfig

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
[*.cs]
1+
root = true
2+
3+
[*.cs]
24
max_line_length = 120
35
charset = utf-8
46

@@ -173,3 +175,18 @@ dotnet_diagnostic.S4456.severity = none
173175

174176
[*.ps1]
175177
end_of_line = crlf
178+
179+
[{tests,benchmarks}/**/*.cs]
180+
181+
dotnet_diagnostic.S2344.severity = none
182+
dotnet_diagnostic.S3010.severity = none
183+
dotnet_diagnostic.S4144.severity = none
184+
dotnet_diagnostic.S3459.severity = none
185+
dotnet_diagnostic.S3453.severity = none
186+
dotnet_diagnostic.S1144.severity = none
187+
dotnet_diagnostic.S1172.severity = none
188+
dotnet_diagnostic.S3963.severity = none
189+
dotnet_diagnostic.S6562.severity = none
190+
dotnet_diagnostic.S2925.severity = none
191+
dotnet_diagnostic.S5034.severity = none
192+
dotnet_diagnostic.S2696.severity = none

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<PrivateAssets>all</PrivateAssets>
3434
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3535
</PackageReference>
36-
<PackageReference Include="Roslynator.Analyzers" Version="4.16.1">
36+
<PackageReference Include="Roslynator.Analyzers" Version="5.0.0">
3737
<PrivateAssets>all</PrivateAssets>
3838
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3939
</PackageReference>

benchmarks/DbConnectionPlus.Benchmarks/Benchmarks.Query_Dynamic.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public List<dynamic> Query_Dynamic_Command()
5353
["ByteValue"] = dataReader.GetByte(ordinal++),
5454
["CharValue"] = dataReader.GetChars(ordinal++, 0, charBuffer, 0, 1) == 1
5555
? charBuffer[0]
56-
: throw new(),
56+
: throw new InvalidOperationException(),
5757
["DateTimeValue"] = DateTime.Parse(dataReader.GetString(ordinal++), CultureInfo.InvariantCulture),
5858
["DecimalValue"] = Decimal.Parse(dataReader.GetString(ordinal++), CultureInfo.InvariantCulture),
5959
["DoubleValue"] = dataReader.GetDouble(ordinal++),
@@ -62,7 +62,7 @@ public List<dynamic> Query_Dynamic_Command()
6262
["Int32Value"] = (Int32)dataReader.GetInt64(ordinal++),
6363
["Int64Value"] = dataReader.GetInt64(ordinal++),
6464
["SingleValue"] = dataReader.GetFloat(ordinal++),
65-
["StringValue"] = dataReader.GetString(ordinal++)
65+
["StringValue"] = dataReader.GetString(ordinal)
6666
};
6767

6868
entities.Add(new DataRow(dictionary));

benchmarks/DbConnectionPlus.Benchmarks/Benchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private static BenchmarkEntity ReadEntity(IDataReader dataReader)
7777
BooleanValue = dataReader.GetInt64(ordinal++) == 1,
7878
BytesValue = (Byte[])dataReader.GetValue(ordinal++),
7979
ByteValue = dataReader.GetByte(ordinal++),
80-
CharValue = dataReader.GetChars(ordinal++, 0, charBuffer, 0, 1) == 1 ? charBuffer[0] : throw new(),
80+
CharValue = dataReader.GetChars(ordinal++, 0, charBuffer, 0, 1) == 1 ? charBuffer[0] : throw new InvalidOperationException(),
8181
DateTimeValue = DateTime.Parse(dataReader.GetString(ordinal++), CultureInfo.InvariantCulture),
8282
DecimalValue = Decimal.Parse(dataReader.GetString(ordinal++), CultureInfo.InvariantCulture),
8383
DoubleValue = dataReader.GetDouble(ordinal++),

tests/DbConnectionPlus.IntegrationTests/DatabaseAdapters/EntityManipulator.InsertEntityTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ await this.CallApi(
109109
TestContext.Current.CancellationToken
110110
);
111111

112-
this.Connection.QueryFirst<MappingTestEntityAttributes>($"SELECT * FROM {Q("MappingTestEntity")}")
112+
(await this.Connection.QueryFirstAsync<MappingTestEntityAttributes>($"SELECT * FROM {Q("MappingTestEntity")}"))
113113
.Should().BeEquivalentTo(
114114
entity,
115115
options => options.Using<String>(context => context.Subject.Should().BeNull())
@@ -137,7 +137,7 @@ await this.CallApi(
137137
TestContext.Current.CancellationToken
138138
);
139139

140-
this.Connection.QueryFirst<MappingTestEntityFluentApi>($"SELECT * FROM {Q("MappingTestEntity")}")
140+
(await this.Connection.QueryFirstAsync<MappingTestEntityFluentApi>($"SELECT * FROM {Q("MappingTestEntity")}"))
141141
.Should().BeEquivalentTo(
142142
entity,
143143
options => options.Using<String>(context => context.Subject.Should().BeNull())
@@ -160,7 +160,7 @@ await this.CallApi(
160160
TestContext.Current.CancellationToken
161161
);
162162

163-
this.Connection.QueryFirst<MappingTestEntity>($"SELECT * FROM {Q("MappingTestEntity")}")
163+
(await this.Connection.QueryFirstAsync<MappingTestEntity>($"SELECT * FROM {Q("MappingTestEntity")}"))
164164
.Should().BeEquivalentTo(entity);
165165
}
166166

tests/DbConnectionPlus.IntegrationTests/DatabaseAdapters/EntityManipulator.UpdateEntityTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ await this.CallApi(
195195
TestContext.Current.CancellationToken
196196
);
197197

198-
this.Connection.QueryFirst<MappingTestEntityAttributes>($"SELECT * FROM {Q("MappingTestEntity")}")
198+
(await this.Connection.QueryFirstAsync<MappingTestEntityAttributes>($"SELECT * FROM {Q("MappingTestEntity")}"))
199199
.Should().BeEquivalentTo(
200200
updatedEntity,
201201
options => options.Using<String>(context => context.Subject.Should().BeNull())
@@ -225,7 +225,7 @@ await this.CallApi(
225225
TestContext.Current.CancellationToken
226226
);
227227

228-
this.Connection.QueryFirst<MappingTestEntityFluentApi>($"SELECT * FROM {Q("MappingTestEntity")}")
228+
(await this.Connection.QueryFirstAsync<MappingTestEntityFluentApi>($"SELECT * FROM {Q("MappingTestEntity")}"))
229229
.Should().BeEquivalentTo(
230230
updatedEntity,
231231
options => options.Using<String>(context => context.Subject.Should().BeNull())
@@ -271,7 +271,7 @@ await this.CallApi(
271271
TestContext.Current.CancellationToken
272272
);
273273

274-
this.Connection.QueryFirst<MappingTestEntity>($"SELECT * FROM {Q("MappingTestEntity")}")
274+
(await this.Connection.QueryFirstAsync<MappingTestEntity>($"SELECT * FROM {Q("MappingTestEntity")}"))
275275
.Should().BeEquivalentTo(updatedEntity);
276276
}
277277

tests/DbConnectionPlus.IntegrationTests/DbConnectionExtensions.QueryFirstOrDefaultTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Boolean useAsyncApi
200200
dataRow
201201
.Should().NotBeNull();
202202

203-
dataRow!["Id"]
203+
dataRow["Id"]
204204
.Should().Be(entityIds[0]);
205205

206206
this.ExistsTemporaryTableInDb(temporaryTableName)

tests/DbConnectionPlus.IntegrationTests/DbConnectionExtensions.QuerySingleOrDefaultTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Boolean useAsyncApi
221221
dataRow
222222
.Should().NotBeNull();
223223

224-
dataRow!["Id"]
224+
dataRow["Id"]
225225
.Should().Be(entityId);
226226

227227
this.ExistsTemporaryTableInDb(temporaryTableName)

tests/DbConnectionPlus.IntegrationTests/DbConnectionPlus.IntegrationTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PackageReference Include="Npgsql" Version="10.0.3" />
2121
<PackageReference Include="NSubstitute" Version="5.3.0" />
2222
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.26.300" />
23-
<PackageReference Include="System.Linq.Async" Version="7.0.1" />
23+
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.11" />
2424
<!--
2525
The four database servers the suite tests against. Testcontainers starts each container on demand and
2626
removes it when the run ends - see TestDatabase/Containers/. Testcontainers.XunitV3, not

tests/DbConnectionPlus.IntegrationTests/IntegrationTestsBase.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ SELECT 1
238238
FROM {Q(metadata.TableName)}
239239
WHERE {String.Join(
240240
" AND ",
241-
[.. keyProperties.Select(p => $"{Q(p.ColumnName)} = {P(p.PropertyName)}")]
241+
keyProperties.Select(p => $"{Q(p.ColumnName)} = {P(p.PropertyName)}").ToList()
242242
)}
243243
""",
244244
keyProperties.Select(p => (p.PropertyName, p.PropertyGetter!(entity))).ToArray()!
@@ -387,7 +387,9 @@ private void InterceptDbCommand(DbCommand command, IReadOnlyList<InterpolatedTem
387387
/// <returns>A <see cref="CancellationToken" /> that will be cancelled after 100 milliseconds.</returns>
388388
protected static CancellationToken CreateCancellationTokenThatIsCancelledAfter100Milliseconds()
389389
{
390+
#pragma warning disable S2930
390391
var cancellationTokenSource = new CancellationTokenSource();
392+
#pragma warning restore S2930
391393
cancellationTokenSource.CancelAfter(100);
392394
return cancellationTokenSource.Token;
393395
}
@@ -397,7 +399,9 @@ protected static CancellationToken CreateCancellationTokenThatIsCancelledAfter10
397399
/// <summary>
398400
/// The connection to the test database for the currently running integration test.
399401
/// </summary>
402+
#pragma warning disable S2743
400403
private static readonly AsyncLocal<DbConnection> currentTestDatabaseConnection = new();
404+
#pragma warning restore S2743
401405

402406
/// <summary>
403407
/// The database adapter for the test database of the currently running integration test.
@@ -406,5 +410,7 @@ protected static CancellationToken CreateCancellationTokenThatIsCancelledAfter10
406410
/// The adapter rather than the provider: an interface that declares a static abstract member - which
407411
/// <see cref="ITestDatabaseProvider.StartDatabaseAsync" /> is - cannot be used as a type argument.
408412
/// </remarks>
413+
#pragma warning disable S2743
409414
private static readonly AsyncLocal<IDatabaseAdapter> currentDatabaseAdapter = new();
415+
#pragma warning restore S2743
410416
}

0 commit comments

Comments
 (0)