-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs + try to add target option to command
- Loading branch information
Richard Werkman
committed
Sep 15, 2023
1 parent
9ebf7f7
commit e1b4d14
Showing
5 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/Stryker.Core/Stryker.Core/Options/Inputs/BaselineTargetInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Stryker.Core.Exceptions; | ||
|
||
namespace Stryker.Core.Options.Inputs | ||
{ | ||
public class BaselineTargetInput : Input<string> | ||
{ | ||
public override string Default => "main"; | ||
protected override string Description => "The target branch/commit to compare with the current codebase when the baseline feature is enabled."; | ||
|
||
public string Validate(bool sinceEnabled) | ||
{ | ||
if (sinceEnabled && SuppliedInput is not null) | ||
{ | ||
if (string.IsNullOrWhiteSpace(SuppliedInput)) | ||
{ | ||
throw new InputException("The baseline target cannot be empty when the since feature is enabled"); | ||
} | ||
|
||
return SuppliedInput; | ||
} | ||
return Default; | ||
} | ||
} | ||
} |