Skip to content

Commit 8f8f8f6

Browse files
author
Bart Koelman
committed
Partial revert of update to Resharper/Rider v2021.2.0
1 parent 1a80bbe commit 8f8f8f6

File tree

13 files changed

+26
-26
lines changed

13 files changed

+26
-26
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2021.2.0",
6+
"version": "2021.1.4",
77
"commands": [
88
"jb"
99
]

Build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function CheckLastExitCode {
88

99
function RunInspectCode {
1010
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
11-
dotnet jb inspectcode JsonApiDotNetCore.sln --debug --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=TRACE -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
11+
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
1212
CheckLastExitCode
1313

1414
[xml]$xml = Get-Content "$outputPath"
@@ -47,7 +47,7 @@ function RunCleanupCode {
4747
$mergeCommitHash = git rev-parse "HEAD"
4848
$targetCommitHash = git rev-parse "$env:APPVEYOR_REPO_BRANCH"
4949

50-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=TRACE --jb --debug -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff
50+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff
5151
CheckLastExitCode
5252
}
5353
}

cleanupcode.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ if ($LASTEXITCODE -ne 0) {
88
throw "Tool restore failed with exit code $LASTEXITCODE"
99
}
1010

11-
dotnet restore
11+
dotnet build -c Release
1212

1313
if ($LASTEXITCODE -ne 0) {
14-
throw "Package restore failed with exit code $LASTEXITCODE"
14+
throw "Build failed with exit code $LASTEXITCODE"
1515
}
1616

1717
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN

inspectcode.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ if ($LASTEXITCODE -ne 0) {
88
throw "Tool restore failed with exit code $LASTEXITCODE"
99
}
1010

11+
dotnet build -c Release
12+
13+
if ($LASTEXITCODE -ne 0) {
14+
throw "Build failed with exit code $LASTEXITCODE"
15+
}
16+
1117
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
1218
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
13-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
19+
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
1420

1521
if ($LASTEXITCODE -ne 0) {
1622
throw "Code inspection failed with exit code $LASTEXITCODE"

src/Examples/JsonApiDotNetCoreExample/Startups/EmptyStartup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public virtual void ConfigureServices(IServiceCollection services)
1515
{
1616
}
1717

18+
// ReSharper disable once UnusedMemberInSuper.Global
19+
// ReSharper disable once UnusedParameter.Global
1820
public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment environment, ILoggerFactory loggerFactory)
1921
{
2022
}

src/JsonApiDotNetCore/Errors/ResourcesInRelationshipsNotFoundException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public ResourcesInRelationshipsNotFoundException(IEnumerable<MissingResourceInRe
1919

2020
private static Error CreateError(MissingResourceInRelationship missingResourceInRelationship)
2121
{
22-
return new Error(HttpStatusCode.NotFound)
22+
return new(HttpStatusCode.NotFound)
2323
{
2424
Title = "A related resource does not exist.",
2525
Detail = $"Related resource of type '{missingResourceInRelationship.ResourceType}' with ID '{missingResourceInRelationship.ResourceId}' " +

src/JsonApiDotNetCore/ObjectExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public static T[] AsArray<T>(this T element)
2121

2222
public static List<T> AsList<T>(this T element)
2323
{
24-
return new List<T>
24+
return new()
2525
{
2626
element
2727
};
2828
}
2929

3030
public static HashSet<T> AsHashSet<T>(this T element)
3131
{
32-
return new HashSet<T>
32+
return new()
3333
{
3434
element
3535
};

src/JsonApiDotNetCore/Serialization/Building/ResourceObjectBuilderSettingsProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public ResourceObjectBuilderSettingsProvider(IDefaultsQueryStringParameterReader
2424
/// <inheritdoc />
2525
public ResourceObjectBuilderSettings Get()
2626
{
27-
return new ResourceObjectBuilderSettings(_nullsReader.SerializerNullValueHandling, _defaultsReader.SerializerDefaultValueHandling);
27+
return new(_nullsReader.SerializerNullValueHandling, _defaultsReader.SerializerDefaultValueHandling);
2828
}
2929
}
3030
}

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/MusicTrackReleaseDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public MusicTrackReleaseDefinition(IResourceGraph resourceGraph, ISystemClock sy
2424

2525
public override QueryStringParameterHandlers<MusicTrack> OnRegisterQueryableHandlersForQueryStringParameters()
2626
{
27-
return new QueryStringParameterHandlers<MusicTrack>
27+
return new()
2828
{
2929
["isRecentlyReleased"] = FilterOnRecentlyReleased
3030
};

test/JsonApiDotNetCoreExampleTests/IntegrationTests/Microservices/Messages/OutgoingMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public T GetContentAs<T>()
2222

2323
public static OutgoingMessage CreateFromContent(IMessageContent content)
2424
{
25-
return new OutgoingMessage
25+
return new()
2626
{
2727
Type = content.GetType().Name,
2828
FormatVersion = content.FormatVersion,

test/TestBuildingBlocks/HttpResponseMessageExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static class HttpResponseMessageExtensions
1414
{
1515
public static HttpResponseMessageAssertions Should(this HttpResponseMessage instance)
1616
{
17-
return new HttpResponseMessageAssertions(instance);
17+
return new(instance);
1818
}
1919

2020
public sealed class HttpResponseMessageAssertions : ReferenceTypeAssertions<HttpResponseMessage, HttpResponseMessageAssertions>

test/UnitTests/Middleware/JsonApiMiddlewareTests.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,9 @@ private static Mock<IJsonApiOptions> CreateMockOptions(string forcedNamespace)
135135

136136
private static DefaultHttpContext CreateHttpContext(string path, bool isRelationship = false, string action = "", string id = null)
137137
{
138-
var context = new DefaultHttpContext
139-
{
140-
Request =
141-
{
142-
Path = new PathString(path)
143-
},
144-
Response =
145-
{
146-
Body = new MemoryStream()
147-
}
148-
};
138+
var context = new DefaultHttpContext();
139+
context.Request.Path = new PathString(path);
140+
context.Response.Body = new MemoryStream();
149141

150142
var feature = new RouteValuesFeature
151143
{

test/UnitTests/Serialization/DeserializerTestsSetup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected Document CreateDocumentWithRelationships(string primaryType, string re
3030

3131
protected Document CreateDocumentWithRelationships(string primaryType)
3232
{
33-
return new Document
33+
return new()
3434
{
3535
Data = new ResourceObject
3636
{
@@ -67,7 +67,7 @@ protected RelationshipEntry CreateRelationshipData(string relatedType = null, bo
6767

6868
protected Document CreateTestResourceDocument()
6969
{
70-
return new Document
70+
return new()
7171
{
7272
Data = new ResourceObject
7373
{

0 commit comments

Comments
 (0)