Skip to content

Commit 554df4b

Browse files
author
Bart Koelman
committed
Addressed cleanupcode/inspectcode issues
1 parent 8a4a05d commit 554df4b

26 files changed

+68
-2
lines changed

Build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ 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 --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
11+
# passing --build instead of --no-build to work around https://youtrack.jetbrains.com/issue/RSRP-487054
12+
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
1213
CheckLastExitCode
1314

1415
[xml]$xml = Get-Content "$outputPath"

src/JsonApiDotNetCore/Controllers/JsonApiEndpoints.cs

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

34
// ReSharper disable CheckNamespace
45
#pragma warning disable AV1505 // Namespace should match with assembly name
56

67
namespace JsonApiDotNetCore.Controllers
78
{
89
// IMPORTANT: An internal copy of this type exists in the SourceGenerators project. Keep these in sync when making changes.
10+
[PublicAPI]
911
[Flags]
1012
public enum JsonApiEndpoints
1113
{

test/JsonApiDotNetCoreTests/IntegrationTests/ControllerActionResults/ToothbrushesController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
namespace JsonApiDotNetCoreTests.IntegrationTests.ControllerActionResults
88
{
9+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
10+
public partial class ToothbrushesController
11+
{
12+
}
13+
914
partial class ToothbrushesController
1015
{
1116
internal const int EmptyActionResultId = 11111111;

test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/CiviliansController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
namespace JsonApiDotNetCoreTests.IntegrationTests.CustomRoutes
66
{
7+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
8+
public partial class CiviliansController
9+
{
10+
}
11+
712
[ApiController]
813
[DisableRoutingConvention]
914
[Route("world-civilians")]

test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/TownsController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
namespace JsonApiDotNetCoreTests.IntegrationTests.CustomRoutes
1414
{
15+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
16+
public partial class TownsController
17+
{
18+
}
19+
1520
[DisableRoutingConvention]
1621
[Route("world-api/civilization/popular/towns")]
1722
partial class TownsController

test/JsonApiDotNetCoreTests/IntegrationTests/HostingInIIS/PaintingsController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
namespace JsonApiDotNetCoreTests.IntegrationTests.HostingInIIS
55
{
6+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
7+
public partial class PaintingsController
8+
{
9+
}
10+
611
[DisableRoutingConvention]
712
[Route("custom/path/to/paintings-of-the-world")]
813
partial class PaintingsController

test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy/WebProductsController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
namespace JsonApiDotNetCoreTests.IntegrationTests.MultiTenancy
55
{
6+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
7+
public partial class WebProductsController
8+
{
9+
}
10+
611
[DisableRoutingConvention]
712
[Route("{countryCode}/products")]
813
partial class WebProductsController

test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy/WebShopsController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
namespace JsonApiDotNetCoreTests.IntegrationTests.MultiTenancy
55
{
6+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
7+
public partial class WebShopsController
8+
{
9+
}
10+
611
[DisableRoutingConvention]
712
[Route("{countryCode}/shops")]
813
partial class WebShopsController

test/JsonApiDotNetCoreTests/IntegrationTests/RestrictedControllers/PillowsController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace JsonApiDotNetCoreTests.IntegrationTests.RestrictedControllers
44
{
5+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
6+
public partial class PillowsController
7+
{
8+
}
9+
510
[DisableQueryString("skipCache")]
611
partial class PillowsController
712
{

test/JsonApiDotNetCoreTests/IntegrationTests/RestrictedControllers/SofasController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
namespace JsonApiDotNetCoreTests.IntegrationTests.RestrictedControllers
55
{
6+
// Workaround for https://youtrack.jetbrains.com/issue/RSRP-487028
7+
public partial class SofasController
8+
{
9+
}
10+
611
[DisableQueryString(JsonApiQueryStringParameters.Sort | JsonApiQueryStringParameters.Page)]
712
partial class SofasController
813
{

test/SourceGeneratorDebugger/Controllers/ArticlesController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using JetBrains.Annotations;
2+
13
namespace SourceGeneratorDebugger.Controllers
24
{
5+
[PublicAPI]
36
partial class ArticlesController
47
{
58
public void ExtraMethod()

test/SourceGeneratorDebugger/Controllers/CustomersController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using JetBrains.Annotations;
12
using JsonApiDotNetCore.Configuration;
23
using JsonApiDotNetCore.Controllers;
34
using JsonApiDotNetCore.Services;
@@ -6,6 +7,7 @@
67

78
namespace SourceGeneratorDebugger.Controllers
89
{
10+
[PublicAPI]
911
public sealed class CustomersController : JsonApiController<Customer, long>
1012
{
1113
public CustomersController(IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory,

test/SourceGeneratorDebugger/JsonApiDotNetCore/ArgumentGuard.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// ReSharper disable CheckNamespace
1+
using JetBrains.Annotations;
22

3+
// ReSharper disable CheckNamespace
34
#pragma warning disable AV1505 // Namespace should match with assembly name
45
#pragma warning disable AV1008 // Class should not be static
56

@@ -9,6 +10,7 @@ namespace JsonApiDotNetCore
910
/// Represents a stripped-down copy of this type in the JsonApiDotNetCore project. It exists solely to fulfill the dependency needs for successfully
1011
/// compiling the source-generated controllers in this project.
1112
/// </summary>
13+
[PublicAPI]
1214
internal static class ArgumentGuard
1315
{
1416
public static void NotNullNorEmpty(string? value, string name)

test/SourceGeneratorDebugger/JsonApiDotNetCore/IAddToRelationshipService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/ICreateService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IDeleteService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetAllService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetByIdService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetRelationshipService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetSecondaryService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IIdentifiable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public interface IIdentifiable
1616
string? LocalId { get; set; }
1717
}
1818

19+
[PublicAPI]
1920
public interface IIdentifiable<TId> : IIdentifiable
2021
{
2122
TId Id { get; set; }

test/SourceGeneratorDebugger/JsonApiDotNetCore/IRemoveFromRelationshipService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/ISetRelationshipService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/JsonApiDotNetCore/IUpdateService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Resources;
33

4+
// ReSharper disable UnusedTypeParameter
45
// ReSharper disable CheckNamespace
56
#pragma warning disable AV1505 // Namespace should match with assembly name
67

test/SourceGeneratorDebugger/Models/Customer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
using JetBrains.Annotations;
12
using JsonApiDotNetCore.Resources;
23
using JsonApiDotNetCore.Resources.Annotations;
34

45
namespace SourceGeneratorDebugger.Models
56
{
7+
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
68
public sealed class Customer : Identifiable<long>
79
{
810
[Attr]

test/SourceGeneratorDebugger/SourceGeneratorDebugger.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<PropertyGroup>
33
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
44
<OutputType>Exe</OutputType>
5+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
6+
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
57
</PropertyGroup>
8+
69
<ItemGroup>
710
<Compile Include="..\..\src\JsonApiDotNetCore\Controllers\JsonApiEndpoints.cs" Link="JsonApiDotNetCore\JsonApiEndpoints.cs" />
811
<Compile Include="..\..\src\JsonApiDotNetCore\Resources\Annotations\ResourceAttribute.cs" Link="JsonApiDotNetCore\ResourceAttribute.cs" />

0 commit comments

Comments
 (0)