Skip to content

Commit

Permalink
fix(tooling): nullable options
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Nov 24, 2024
1 parent d9f3727 commit df620ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Nuke.Tooling/ToolTasks.Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Nuke.Common.Tooling;

partial class ToolTasks
{
protected virtual IReadOnlyCollection<Output> Run(ToolOptions options)
protected virtual partial IReadOnlyCollection<Output> Run(ToolOptions options)
{
var secrets = options.GetSecrets().ToList();
var secrets = options?.GetSecrets().ToList() ?? [];
string Filter(string text) => secrets.Aggregate(text, (str, s) => str.Replace(s, "[REDACTED]"));

options = PreProcess(options);
Expand All @@ -35,7 +35,7 @@ protected virtual IReadOnlyCollection<Output> Run(ToolOptions options)
return process.Output;
}

protected virtual (TResult Result, IReadOnlyCollection<Output> Output) Run<TResult>(ToolOptions options)
protected virtual partial (TResult Result, IReadOnlyCollection<Output> Output) Run<TResult>(ToolOptions options)
{
var output = Run(options);
try
Expand Down
2 changes: 2 additions & 0 deletions source/Nuke.Tooling/ToolTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public abstract partial class ToolTasks
protected internal virtual partial Action<OutputType, string> GetLogger(ToolOptions options = null);

protected virtual partial string GetToolPath(ToolOptions options = null);
protected virtual partial IReadOnlyCollection<Output> Run(ToolOptions options = null);
protected virtual partial (TResult Result, IReadOnlyCollection<Output> Output) Run<TResult>(ToolOptions options = null);
protected virtual partial Func<ToolOptions, IProcess, object> GetExitHandler(ToolOptions options = null);

protected virtual ToolOptions PreProcess(ToolOptions options) => options;

Check warning on line 24 in source/Nuke.Tooling/ToolTasks.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Use preferred body style (convert into method or operator with preferred body style)

Code body does not conform to code style settings: use statement body
Expand Down

0 comments on commit df620ac

Please sign in to comment.