Skip to content

Commit 04f5357

Browse files
author
roeil
committed
feat(paths-filter): follow pr
1 parent 71d9a25 commit 04f5357

35 files changed

+190
-34
lines changed

docs/input/docs/workflows/GitFlow/v1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ branches:
148148
is-main-branch: false
149149
ignore:
150150
sha: []
151+
paths: []
151152
mode: ContinuousDelivery
152153
label: '{BranchName}'
153154
increment: Inherit

docs/input/docs/workflows/GitHubFlow/v1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ branches:
9797
is-main-branch: false
9898
ignore:
9999
sha: []
100+
paths: []
100101
mode: ContinuousDelivery
101102
label: '{BranchName}'
102103
increment: Inherit

docs/input/docs/workflows/TrunkBased/preview1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ branches:
8282
pre-release-weight: 30000
8383
ignore:
8484
sha: []
85+
paths: []
8586
mode: ContinuousDelivery
8687
label: '{BranchName}'
8788
increment: Inherit

schemas/6.1/GitVersion.configuration.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@
189189
"null"
190190
]
191191
},
192+
"paths": {
193+
"description": "A sequence of file paths to be excluded from the version calculations.",
194+
"type": "array",
195+
"items": {
196+
"type": "string"
197+
}
198+
},
192199
"sha": {
193200
"description": "A sequence of SHAs to be excluded from the version calculations.",
194201
"$ref": "#/$defs/hashSetOfString"

src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ branches:
148148
is-main-branch: false
149149
ignore:
150150
sha: []
151+
paths: []
151152
mode: ContinuousDelivery
152153
label: '{BranchName}'
153154
increment: Inherit

src/GitVersion.Configuration.Tests/Workflows/approved/GitFlow/v1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ branches:
148148
is-main-branch: false
149149
ignore:
150150
sha: []
151+
paths: []
151152
mode: ContinuousDelivery
152153
label: '{BranchName}'
153154
increment: Inherit

src/GitVersion.Configuration.Tests/Workflows/approved/GitHubFlow/v1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ branches:
9797
is-main-branch: false
9898
ignore:
9999
sha: []
100+
paths: []
100101
mode: ContinuousDelivery
101102
label: '{BranchName}'
102103
increment: Inherit

src/GitVersion.Configuration.Tests/Workflows/approved/TrunkBased/preview1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ branches:
8282
pre-release-weight: 30000
8383
ignore:
8484
sha: []
85+
paths: []
8586
mode: ContinuousDelivery
8687
label: '{BranchName}'
8788
increment: Inherit

src/GitVersion.Configuration/IgnoreConfiguration.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.ObjectModel;
12
using GitVersion.Configuration.Attributes;
23

34
namespace GitVersion.Configuration;
@@ -24,5 +25,11 @@ public string? BeforeString
2425
public HashSet<string> Shas { get; init; } = [];
2526

2627
[JsonIgnore]
27-
public bool IsEmpty => Before == null && Shas.Count == 0;
28+
public bool IsEmpty => Before == null && Shas.Count == 0 && Paths.Count == 0;
29+
30+
IReadOnlyCollection<string> IIgnoreConfiguration.Paths => Paths;
31+
32+
[JsonPropertyName("paths")]
33+
[JsonPropertyDescription("A sequence of file paths to be excluded from the version calculations.")]
34+
public Collection<string> Paths { get; init; } = [];
2835
}

src/GitVersion.Core.Tests/VersionCalculation/MinDateVersionFilterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public void VerifyNullGuard()
1212
var dummy = DateTimeOffset.UtcNow.AddSeconds(1.0);
1313
var sut = new MinDateVersionFilter(dummy);
1414

15-
Should.Throw<ArgumentNullException>(() => sut.Exclude(null!, out _));
15+
Should.Throw<ArgumentNullException>(() => sut.Exclude((IBaseVersion)null!, out _));
1616
}
1717

1818
[Test]

0 commit comments

Comments
 (0)