Skip to content

Commit 3fd9aa2

Browse files
authored
Make properties init-only (#392)
1 parent 5c566f1 commit 3fd9aa2

14 files changed

+99
-92
lines changed

src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
using System.Collections.Generic;
45
using Cake.Common.Build.AzurePipelines.Data;

src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildArtifact.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
/// <summary>
45
/// Represents an artifact associated with a build.

src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildDefinition.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
/// <summary>
45
/// Representation of a build definition.

src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsSettings.cs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
using System;
45
using Cake.AzureDevOps.Authentication;
@@ -53,41 +54,41 @@ public AzureDevOpsBuildsSettings(IAzureDevOpsCredentials credentials)
5354
}
5455

5556
/// <summary>
56-
/// Gets or sets the name of the build definition.
57+
/// Gets the name of the build definition.
5758
/// Can be <c>null</c> or <see cref="string.Empty"/>.
5859
/// </summary>
59-
public string BuildDefinitionName { get; set; }
60+
public string BuildDefinitionName { get; init; }
6061

6162
/// <summary>
62-
/// Gets or sets the name of the branch.
63+
/// Gets the name of the branch.
6364
/// Can be <c>null</c> or <see cref="string.Empty"/>.
6465
/// </summary>
65-
public string BranchName { get; set; }
66+
public string BranchName { get; init; }
6667

6768
/// <summary>
68-
/// Gets or sets the build status.
69+
/// Gets the build status.
6970
/// </summary>
70-
public AzureDevOpsBuildStatus? BuildStatus { get; set; }
71+
public AzureDevOpsBuildStatus? BuildStatus { get; init; }
7172

7273
/// <summary>
73-
/// Gets or sets the build result.
74+
/// Gets the build result.
7475
/// </summary>
75-
public AzureDevOpsBuildResult? BuildResult { get; set; }
76+
public AzureDevOpsBuildResult? BuildResult { get; init; }
7677

7778
/// <summary>
78-
/// Gets or sets the build query order.
79+
/// Gets the build query order.
7980
/// </summary>
80-
public AzureDevOpsBuildQueryOrder? BuildQueryOrder { get; set; }
81+
public AzureDevOpsBuildQueryOrder? BuildQueryOrder { get; init; }
8182

8283
/// <summary>
83-
/// Gets or sets the maximum number of builds per definition.
84+
/// Gets the maximum number of builds per definition.
8485
/// </summary>
85-
public int? MaxBuildsPerDefinition { get; set; }
86+
public int? MaxBuildsPerDefinition { get; init; }
8687

8788
/// <summary>
88-
/// Gets or sets the maximum number of builds.
89+
/// Gets the maximum number of builds.
8990
/// </summary>
90-
public int? Top { get; set; }
91+
public int? Top { get; init; }
9192

9293
/// <summary>
9394
/// Constructs the settings object using the access token provided by Azure Pipelines.

src/Cake.AzureDevOps/Pipelines/AzureDevOpsChange.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
using System;
45

src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestResult.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
/// <summary>
45
/// Represents a test result associated with a <see cref="AzureDevOpsTestRun" />.

src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecord.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Pipelines
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Pipelines
23
{
34
using System;
45

src/Cake.AzureDevOps/Repos/AzureDevOpsCommit.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace Cake.AzureDevOps.Repos
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace Cake.AzureDevOps.Repos
23
{
34
using System.Collections.Generic;
45

src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestIterationChange.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
public class AzureDevOpsPullRequestIterationChange
99
{
1010
/// <summary>
11-
/// Gets or sets the file path the iteration change is associated with.
11+
/// Gets the file path the iteration change is associated with.
1212
/// </summary>
13-
public FilePath ItemPath { get; set; }
13+
public FilePath ItemPath { get; init; }
1414

1515
/// <summary>
16-
/// Gets or sets the id of the iteration change.
16+
/// Gets the id of the iteration change.
1717
/// </summary>
18-
public int ChangeId { get; set; }
18+
public int ChangeId { get; init; }
1919

2020
/// <summary>
21-
/// Gets or sets the tracking id of the iteration change.
21+
/// Gets the tracking id of the iteration change.
2222
/// </summary>
23-
public int ChangeTrackingId { get; set; }
23+
public int ChangeTrackingId { get; init; }
2424
}
2525
}

src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public AzureDevOpsPullRequestSettings(IAzureDevOpsCredentials credentials)
8484
/// <summary>
8585
/// Gets the ID of the pull request.
8686
/// </summary>
87-
public int? PullRequestId { get; private set; }
87+
public int? PullRequestId { get; }
8888

8989
/// <summary>
9090
/// Gets or sets a value indicating whether an exception should be thrown if

0 commit comments

Comments
 (0)