Skip to content

Commit

Permalink
Merge pull request #311 from AdmiringWorm/remove-deprecations
Browse files Browse the repository at this point in the history
+semver: major
  • Loading branch information
AdmiringWorm authored May 4, 2024
2 parents 6ba6ff8 + ed17520 commit e5c6da2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 203 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,6 @@ dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

# SA1516: Elements should be separated by blank line
dotnet_diagnostic.SA1516.severity = none
65 changes: 0 additions & 65 deletions Source/Cake.Codecov.Tests/CodecovRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,32 +258,6 @@ public void Should_Set_Commit()
result.Args.Should().Be(@"--sha ""603e02d40093d0649cfa787d846ae4ccc038085c""");
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Enable_DryRun_When_DisableNetwork_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { DisableNetwork = true } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be("--dryRun");
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Enable_DryRun_When_Dump_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { Dump = true } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be("--dryRun");
}

[Fact]
public void Should_Enable_DryRun()
{
Expand Down Expand Up @@ -388,19 +362,6 @@ public void Should_Set_Name()
result.Args.Should().Be(@"--name ""custom name""");
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Ignore_NoColor()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { NoColor = true } };

// When
var result = fixture.Run();

// Then
result.Args.Should().BeNullOrEmpty();
}

[Fact]
public void Should_Set_Pr()
{
Expand All @@ -414,19 +375,6 @@ public void Should_Set_Pr()
result.Args.Should().Be(@"--pr ""1""");
}

[Fact, Obsolete("Remove in v2.0.0")]
public void Should_Enable_NonZero_When_Required_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { Required = true } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be("--nonZero");
}

[Fact]
public void Should_Enable_NonZero()
{
Expand All @@ -453,19 +401,6 @@ public void Should_Sete_ParentSha()
result.Args.Should().Be(@"--parent ""some-kind-of-sha""");
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Set_RootDirectory_When_Root_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { Root = @".\working" } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be(@"--rootDir ""working""");
}

[Fact]
public void Should_Set_RootDirectory()
{
Expand Down
71 changes: 0 additions & 71 deletions Source/Cake.Codecov.Tests/CodecovSettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,6 @@ public void Should_Set_Clean_Value()
settings.CleanReports.Should().BeTrue();
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Set_DisableNetwork_Value()
{
// Given
var settings = new CodecovSettings
{
// When
DisableNetwork = true
};

// Then
settings.DisableNetwork.Should().BeTrue();
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Set_Dump_Value()
{
// Given
var settings = new CodecovSettings
{
// When
Dump = true
};

// Then
settings.Dump.Should().BeTrue();
}

[Fact]
public void Should_Set_EnableGcovSupport_Value()
{
Expand Down Expand Up @@ -202,20 +174,6 @@ public void Should_Set_Name_Value()
settings.Name.Should().Be(expected);
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Not_Set_NoColor_Value()
{
// Given
var settings = new CodecovSettings
{
// When
NoColor = true
};

// Then
settings.NoColor.Should().BeFalse();
}

[Fact]
public void Should_Set_ParentSha_Value()
{
Expand Down Expand Up @@ -246,35 +204,6 @@ public void Should_Set_Pr_Value()
settings.Pr.Should().Be(expected);
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Set_Required_Value()
{
// Given
var settings = new CodecovSettings
{
// When
Required = true
};

// Then
settings.Required.Should().BeTrue();
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Set_Root_Value()
{
// Given
var expected = (DirectoryPath)"C:/test/root";
var settings = new CodecovSettings
{
// When
Root = expected
};

// Then
settings.Root.Should().BeEquivalentTo(expected);
}

[Fact]
public void Should_Set_RootDirectory_Value()
{
Expand Down
65 changes: 0 additions & 65 deletions Source/Cake.Codecov/CodecovSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,6 @@ public string Commit
set => SetValue("--sha", value);
}

/// <summary>
/// Gets or sets a value indicating whether to toggle functionalities. (1)
/// --disable-network. Disable uploading the file network.
/// </summary>
/// <value>
/// A value indicating whether to toggle functionalities. (1) --disable-network. Disable
/// uploading the file network.
/// </value>
/// <remarks>
/// This function has been made a no-op, and do not have any functionality.
/// </remarks>
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'DryRun' instead.")]
public bool DisableNetwork
{
get => DryRun;
set => DryRun = value;
}

/// <summary>
/// Gets or sets a value indicating whether to don't upload and dump to stdin.
/// </summary>
/// <value>A value indicating whether to don't upload and dump to stdin.</value>
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'DryRun' instead.")]
public bool Dump
{
get => DryRun;
set => DryRun = value;
}

/// <summary>
/// Gets or sets a value indicating whether files should be uploaded to Codecov.
/// </summary>
Expand Down Expand Up @@ -177,17 +148,6 @@ public string Name
set => SetValue("--name", value);
}

/// <summary>
/// Gets or sets a value indicating whether to remove color from the output.
/// </summary>
/// <value>A value indicating whether to remove color from the output.</value>
[Obsolete("This property have been deprecated, and will be removed in v2.0.0.")]
public bool NoColor
{
get => false;
set { }
}

/// <summary>
/// Gets or sets a value indicating whether Codecov should exit with a non-zero exit code on errors.
/// </summary>
Expand Down Expand Up @@ -221,31 +181,6 @@ public string Pr
set => SetValue("--pr", value);
}

/// <summary>
/// Gets or sets a value indicating whether to exit with 1 if not successful. Default will
/// Exit with 0.
/// </summary>
/// <value>
/// A value indicating whether to exit with 1 if not successful. Default will Exit with 0.
/// </value>
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'NonZero' instead.")]
public bool Required
{
get => NonZero;
set => NonZero = value;
}

/// <summary>
/// Gets or sets a value used when not in git project to identify project root directory.
/// </summary>
/// <value>A value used when not in git project to identify project root directory.</value>
[Obsolete("This property have been deprecated, and will be removed in v2.0.0. Use property 'RootDirectory' instead.")]
public DirectoryPath Root
{
get => RootDirectory;
set => RootDirectory = value;
}

/// <summary>
/// Gets or sets the root directory when it is not a git repository.
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions setup.cake
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ BuildParameters.Tasks.UploadCodecovReportTask
Codecov(new CodecovSettings {{
Files = new[] {{ ""{1}"" }},
RootDirectory = ""{2}"",
NonZero = true,
DryRun = string.IsNullOrEmpty(EnvironmentVariable(""CODECOV_TOKEN""))
NonZero = !string.IsNullOrEmpty(EnvironmentVariable(""CODECOV_TOKEN""))
}});",
nugetPkg, coverageFilter, BuildParameters.RootDirectoryPath);

Expand Down

0 comments on commit e5c6da2

Please sign in to comment.