Skip to content

Commit 558d8b4

Browse files
authored
Resharper tweaks (#1413)
* Add directive to correct formatting style * Promote Global:PropertyCanBeMadeInitOnly to warning, so it aligns with what Resharper shows in VS, and address new violations
1 parent c473652 commit 558d8b4

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

WarningSeverities.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NestedStringInterpolation/@EntryIndexedValue">WARNING</s:String>
123123
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedField_002EGlobal/@EntryIndexedValue">WARNING</s:String>
124124
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=OutdentIsOffPrevLevel/@EntryIndexedValue">WARNING</s:String>
125+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PropertyCanBeMadeInitOnly_002EGlobal/@EntryIndexedValue">WARNING</s:String>
125126
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PropertyCanBeMadeInitOnly_002ELocal/@EntryIndexedValue">WARNING</s:String>
126127
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
127128
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RawStringCanBeSimplified/@EntryIndexedValue">WARNING</s:String>

src/JsonApiDotNetCore/Serialization/Objects/Document.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using System.Text.Json.Serialization;
2+
using JetBrains.Annotations;
23

34
namespace JsonApiDotNetCore.Serialization.Objects;
45

56
/// <summary>
67
/// See https://jsonapi.org/format#document-top-level and https://jsonapi.org/ext/atomic/#document-structure.
78
/// </summary>
9+
[PublicAPI]
810
public sealed class Document
911
{
1012
[JsonPropertyName("jsonapi")]

test/DapperTests/IntegrationTests/FrozenClock.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using DapperExample;
22
using FluentAssertions.Extensions;
3+
using JetBrains.Annotations;
34

45
namespace DapperTests.IntegrationTests;
56

7+
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
68
internal sealed class FrozenClock : IClock
79
{
810
private static readonly DateTimeOffset DefaultTime = 1.January(2020).At(1, 1, 1).AsUtc();

test/UnitTests/Internal/ErrorObjectTests.cs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,15 @@ namespace UnitTests.Internal;
77

88
public sealed class ErrorObjectTests
99
{
10-
// Formatting below is broken due to Resharper bug at https://youtrack.jetbrains.com/issue/RSRP-494897/Formatter-directive-broken-in-2023.3-EAP7.
11-
// This no longer works: @formatter:wrap_array_initializer_style wrap_if_long
10+
// @formatter:wrap_array_initializer_style wrap_if_long
11+
// @formatter:max_array_initializer_elements_on_line 10
1212
[Theory]
13-
[InlineData(new[]
14-
{
15-
HttpStatusCode.UnprocessableEntity
16-
}, HttpStatusCode.UnprocessableEntity)]
17-
[InlineData(new[]
18-
{
19-
HttpStatusCode.UnprocessableEntity,
20-
HttpStatusCode.UnprocessableEntity
21-
}, HttpStatusCode.UnprocessableEntity)]
22-
[InlineData(new[]
23-
{
24-
HttpStatusCode.UnprocessableEntity,
25-
HttpStatusCode.Unauthorized
26-
}, HttpStatusCode.BadRequest)]
27-
[InlineData(new[]
28-
{
29-
HttpStatusCode.UnprocessableEntity,
30-
HttpStatusCode.BadGateway
31-
}, HttpStatusCode.InternalServerError)]
13+
[InlineData(new[] { HttpStatusCode.UnprocessableEntity }, HttpStatusCode.UnprocessableEntity)]
14+
[InlineData(new[] { HttpStatusCode.UnprocessableEntity, HttpStatusCode.UnprocessableEntity }, HttpStatusCode.UnprocessableEntity)]
15+
[InlineData(new[] { HttpStatusCode.UnprocessableEntity, HttpStatusCode.Unauthorized }, HttpStatusCode.BadRequest)]
16+
[InlineData(new[] { HttpStatusCode.UnprocessableEntity, HttpStatusCode.BadGateway }, HttpStatusCode.InternalServerError)]
17+
// @formatter:max_array_initializer_elements_on_line restore
18+
// @formatter:wrap_array_initializer_style restore
3219
public void ErrorDocument_GetErrorStatusCode_IsCorrect(HttpStatusCode[] errorCodes, HttpStatusCode expected)
3320
{
3421
// Arrange

0 commit comments

Comments
 (0)