Skip to content

Commit e5c6da2

Browse files
authored
Merge pull request #311 from AdmiringWorm/remove-deprecations
+semver: major
2 parents 6ba6ff8 + ed17520 commit e5c6da2

File tree

5 files changed

+4
-203
lines changed

5 files changed

+4
-203
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,6 @@ dotnet_naming_style.begins_with_i.required_prefix = I
210210
dotnet_naming_style.begins_with_i.required_suffix =
211211
dotnet_naming_style.begins_with_i.word_separator =
212212
dotnet_naming_style.begins_with_i.capitalization = pascal_case
213+
214+
# SA1516: Elements should be separated by blank line
215+
dotnet_diagnostic.SA1516.severity = none

Source/Cake.Codecov.Tests/CodecovRunnerTests.cs

-65
Original file line numberDiff line numberDiff line change
@@ -258,32 +258,6 @@ public void Should_Set_Commit()
258258
result.Args.Should().Be(@"--sha ""603e02d40093d0649cfa787d846ae4ccc038085c""");
259259
}
260260

261-
[Fact, Obsolete("Remove test in v2.0.0")]
262-
public void Should_Enable_DryRun_When_DisableNetwork_Is_Set()
263-
{
264-
// Given
265-
var fixture = new CodecovRunnerFixture { Settings = { DisableNetwork = true } };
266-
267-
// When
268-
var result = fixture.Run();
269-
270-
// Then
271-
result.Args.Should().Be("--dryRun");
272-
}
273-
274-
[Fact, Obsolete("Remove test in v2.0.0")]
275-
public void Should_Enable_DryRun_When_Dump_Is_Set()
276-
{
277-
// Given
278-
var fixture = new CodecovRunnerFixture { Settings = { Dump = true } };
279-
280-
// When
281-
var result = fixture.Run();
282-
283-
// Then
284-
result.Args.Should().Be("--dryRun");
285-
}
286-
287261
[Fact]
288262
public void Should_Enable_DryRun()
289263
{
@@ -388,19 +362,6 @@ public void Should_Set_Name()
388362
result.Args.Should().Be(@"--name ""custom name""");
389363
}
390364

391-
[Fact, Obsolete("Remove test in v2.0.0")]
392-
public void Should_Ignore_NoColor()
393-
{
394-
// Given
395-
var fixture = new CodecovRunnerFixture { Settings = { NoColor = true } };
396-
397-
// When
398-
var result = fixture.Run();
399-
400-
// Then
401-
result.Args.Should().BeNullOrEmpty();
402-
}
403-
404365
[Fact]
405366
public void Should_Set_Pr()
406367
{
@@ -414,19 +375,6 @@ public void Should_Set_Pr()
414375
result.Args.Should().Be(@"--pr ""1""");
415376
}
416377

417-
[Fact, Obsolete("Remove in v2.0.0")]
418-
public void Should_Enable_NonZero_When_Required_Is_Set()
419-
{
420-
// Given
421-
var fixture = new CodecovRunnerFixture { Settings = { Required = true } };
422-
423-
// When
424-
var result = fixture.Run();
425-
426-
// Then
427-
result.Args.Should().Be("--nonZero");
428-
}
429-
430378
[Fact]
431379
public void Should_Enable_NonZero()
432380
{
@@ -453,19 +401,6 @@ public void Should_Sete_ParentSha()
453401
result.Args.Should().Be(@"--parent ""some-kind-of-sha""");
454402
}
455403

456-
[Fact, Obsolete("Remove test in v2.0.0")]
457-
public void Should_Set_RootDirectory_When_Root_Is_Set()
458-
{
459-
// Given
460-
var fixture = new CodecovRunnerFixture { Settings = { Root = @".\working" } };
461-
462-
// When
463-
var result = fixture.Run();
464-
465-
// Then
466-
result.Args.Should().Be(@"--rootDir ""working""");
467-
}
468-
469404
[Fact]
470405
public void Should_Set_RootDirectory()
471406
{

Source/Cake.Codecov.Tests/CodecovSettingsTests.cs

-71
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,6 @@ public void Should_Set_Clean_Value()
8585
settings.CleanReports.Should().BeTrue();
8686
}
8787

88-
[Fact, Obsolete("Remove test in v2.0.0")]
89-
public void Should_Set_DisableNetwork_Value()
90-
{
91-
// Given
92-
var settings = new CodecovSettings
93-
{
94-
// When
95-
DisableNetwork = true
96-
};
97-
98-
// Then
99-
settings.DisableNetwork.Should().BeTrue();
100-
}
101-
102-
[Fact, Obsolete("Remove test in v2.0.0")]
103-
public void Should_Set_Dump_Value()
104-
{
105-
// Given
106-
var settings = new CodecovSettings
107-
{
108-
// When
109-
Dump = true
110-
};
111-
112-
// Then
113-
settings.Dump.Should().BeTrue();
114-
}
115-
11688
[Fact]
11789
public void Should_Set_EnableGcovSupport_Value()
11890
{
@@ -202,20 +174,6 @@ public void Should_Set_Name_Value()
202174
settings.Name.Should().Be(expected);
203175
}
204176

205-
[Fact, Obsolete("Remove test in v2.0.0")]
206-
public void Should_Not_Set_NoColor_Value()
207-
{
208-
// Given
209-
var settings = new CodecovSettings
210-
{
211-
// When
212-
NoColor = true
213-
};
214-
215-
// Then
216-
settings.NoColor.Should().BeFalse();
217-
}
218-
219177
[Fact]
220178
public void Should_Set_ParentSha_Value()
221179
{
@@ -246,35 +204,6 @@ public void Should_Set_Pr_Value()
246204
settings.Pr.Should().Be(expected);
247205
}
248206

249-
[Fact, Obsolete("Remove test in v2.0.0")]
250-
public void Should_Set_Required_Value()
251-
{
252-
// Given
253-
var settings = new CodecovSettings
254-
{
255-
// When
256-
Required = true
257-
};
258-
259-
// Then
260-
settings.Required.Should().BeTrue();
261-
}
262-
263-
[Fact, Obsolete("Remove test in v2.0.0")]
264-
public void Should_Set_Root_Value()
265-
{
266-
// Given
267-
var expected = (DirectoryPath)"C:/test/root";
268-
var settings = new CodecovSettings
269-
{
270-
// When
271-
Root = expected
272-
};
273-
274-
// Then
275-
settings.Root.Should().BeEquivalentTo(expected);
276-
}
277-
278207
[Fact]
279208
public void Should_Set_RootDirectory_Value()
280209
{

Source/Cake.Codecov/CodecovSettings.cs

-65
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,6 @@ public string Commit
6161
set => SetValue("--sha", value);
6262
}
6363

64-
/// <summary>
65-
/// Gets or sets a value indicating whether to toggle functionalities. (1)
66-
/// --disable-network. Disable uploading the file network.
67-
/// </summary>
68-
/// <value>
69-
/// A value indicating whether to toggle functionalities. (1) --disable-network. Disable
70-
/// uploading the file network.
71-
/// </value>
72-
/// <remarks>
73-
/// This function has been made a no-op, and do not have any functionality.
74-
/// </remarks>
75-
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'DryRun' instead.")]
76-
public bool DisableNetwork
77-
{
78-
get => DryRun;
79-
set => DryRun = value;
80-
}
81-
82-
/// <summary>
83-
/// Gets or sets a value indicating whether to don't upload and dump to stdin.
84-
/// </summary>
85-
/// <value>A value indicating whether to don't upload and dump to stdin.</value>
86-
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'DryRun' instead.")]
87-
public bool Dump
88-
{
89-
get => DryRun;
90-
set => DryRun = value;
91-
}
92-
9364
/// <summary>
9465
/// Gets or sets a value indicating whether files should be uploaded to Codecov.
9566
/// </summary>
@@ -177,17 +148,6 @@ public string Name
177148
set => SetValue("--name", value);
178149
}
179150

180-
/// <summary>
181-
/// Gets or sets a value indicating whether to remove color from the output.
182-
/// </summary>
183-
/// <value>A value indicating whether to remove color from the output.</value>
184-
[Obsolete("This property have been deprecated, and will be removed in v2.0.0.")]
185-
public bool NoColor
186-
{
187-
get => false;
188-
set { }
189-
}
190-
191151
/// <summary>
192152
/// Gets or sets a value indicating whether Codecov should exit with a non-zero exit code on errors.
193153
/// </summary>
@@ -221,31 +181,6 @@ public string Pr
221181
set => SetValue("--pr", value);
222182
}
223183

224-
/// <summary>
225-
/// Gets or sets a value indicating whether to exit with 1 if not successful. Default will
226-
/// Exit with 0.
227-
/// </summary>
228-
/// <value>
229-
/// A value indicating whether to exit with 1 if not successful. Default will Exit with 0.
230-
/// </value>
231-
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'NonZero' instead.")]
232-
public bool Required
233-
{
234-
get => NonZero;
235-
set => NonZero = value;
236-
}
237-
238-
/// <summary>
239-
/// Gets or sets a value used when not in git project to identify project root directory.
240-
/// </summary>
241-
/// <value>A value used when not in git project to identify project root directory.</value>
242-
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'RootDirectory' instead.")]
243-
public DirectoryPath Root
244-
{
245-
get => RootDirectory;
246-
set => RootDirectory = value;
247-
}
248-
249184
/// <summary>
250185
/// Gets or sets the root directory when it is not a git repository.
251186
/// </summary>

setup.cake

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ BuildParameters.Tasks.UploadCodecovReportTask
6464
Codecov(new CodecovSettings {{
6565
Files = new[] {{ ""{1}"" }},
6666
RootDirectory = ""{2}"",
67-
NonZero = true,
68-
DryRun = string.IsNullOrEmpty(EnvironmentVariable(""CODECOV_TOKEN""))
67+
NonZero = !string.IsNullOrEmpty(EnvironmentVariable(""CODECOV_TOKEN""))
6968
}});",
7069
nugetPkg, coverageFilter, BuildParameters.RootDirectoryPath);
7170

0 commit comments

Comments
 (0)