Skip to content

Commit 2c13b85

Browse files
author
tadeas.zribko
committed
feat: Add Qodana configuration for code quality analysis
- Introduce qodana.yaml for .NET project analysis configuration. - Set up bootstrap commands for restoring and building the project before analysis.
1 parent fc11802 commit 2c13b85

3 files changed

Lines changed: 44 additions & 12 deletions

File tree

qodana.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# https://www.jetbrains.com/help/qodana/qodana-yaml.html
2+
# Do not store secrets here — this file is embedded in Qodana reports.
3+
4+
version: "1.0"
5+
6+
linter: qodana-dotnet
7+
8+
profile:
9+
name: qodana.starter
10+
11+
# Restore + Release build before analysis (semantic model, source generators).
12+
# RESTORE_TOOLS/HUSKY match .github/workflows/pr-validation.yml.
13+
bootstrap: |
14+
RESTORE_TOOLS=0 HUSKY=0 dotnet restore APITemplate.slnx
15+
RESTORE_TOOLS=0 HUSKY=0 dotnet build APITemplate.slnx --no-restore --configuration Release
16+
17+
# include:
18+
# - name: <InspectionId>
19+
#
20+
# exclude:
21+
# - name: <InspectionId>
22+
# paths:
23+
# - relative/path
24+
#
25+
# Quality gate (total problem count; works with Community for .NET):
26+
# failThreshold: 0
27+
#
28+
# severityThresholds in failureConditions are not supported on Qodana Community for .NET.

src/Modules/Identity/Features/V1/TenantInvitationsController.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Identity.Controllers.V1;
99

1010
[ApiVersion(1.0)]
11-
[Route("api/v{version:apiVersion}/tenant-invitations")]
1211
public sealed class TenantInvitationsController(IMessageBus bus) : ApiControllerBase
1312
{
1413
[HttpGet]
@@ -19,10 +18,9 @@ public async Task<ActionResult<PagedResponse<TenantInvitationResponse>>> GetAll(
1918
CancellationToken ct
2019
)
2120
{
22-
ErrorOr<PagedResponse<TenantInvitationResponse>> result = await bus.InvokeAsync<ErrorOr<PagedResponse<TenantInvitationResponse>>>(
23-
new GetTenantInvitationsQuery(filter),
24-
ct
25-
);
21+
ErrorOr<PagedResponse<TenantInvitationResponse>> result = await bus.InvokeAsync<
22+
ErrorOr<PagedResponse<TenantInvitationResponse>>
23+
>(new GetTenantInvitationsQuery(filter), ct);
2624
return result.ToActionResult(this);
2725
}
2826

@@ -33,19 +31,25 @@ public async Task<ActionResult<TenantInvitationResponse>> Create(
3331
CancellationToken ct
3432
)
3533
{
36-
ErrorOr<TenantInvitationResponse> result = await bus.InvokeAsync<ErrorOr<TenantInvitationResponse>>(
37-
new CreateTenantInvitationCommand(request),
38-
ct
39-
);
34+
ErrorOr<TenantInvitationResponse> result = await bus.InvokeAsync<
35+
ErrorOr<TenantInvitationResponse>
36+
>(new CreateTenantInvitationCommand(request), ct);
4037
if (result.IsError)
4138
return result.ToActionResult(this);
4239

43-
return CreatedAtAction(nameof(GetAll), new { version = this.GetApiVersion() }, result.Value);
40+
return CreatedAtAction(
41+
nameof(GetAll),
42+
new { version = this.GetApiVersion() },
43+
result.Value
44+
);
4445
}
4546

4647
[HttpPost("accept")]
4748
[AllowAnonymous]
48-
public async Task<IActionResult> Accept([FromBody] AcceptInvitationRequest request, CancellationToken ct)
49+
public async Task<IActionResult> Accept(
50+
[FromBody] AcceptInvitationRequest request,
51+
CancellationToken ct
52+
)
4953
{
5054
ErrorOr<Success> result = await bus.InvokeAsync<ErrorOr<Success>>(
5155
new AcceptTenantInvitationCommand(request.Token),
@@ -76,4 +80,3 @@ public async Task<IActionResult> Resend(Guid id, CancellationToken ct)
7680
return result.ToOkResult(this);
7781
}
7882
}
79-

src/SharedKernel/Contracts/Api/ApiControllerBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace SharedKernel.Contracts.Api;
55

66
[ApiController]
7+
// ReSharper disable once RouteTemplates.RouteParameterConstraintNotResolved
78
[Route("api/v{version:apiVersion}/[controller]")]
89
public abstract class ApiControllerBase : ControllerBase
910
{

0 commit comments

Comments
 (0)