Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
phmatray committed May 15, 2024
1 parent e700ab3 commit 46398c3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions MasterCommander.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/SweaWarningsMode/@EntryValue">ShowAndRun</s:String>
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">/Users/philippe/Library/Caches/JetBrains/Rider2024.1/resharper-host/temp/Rider/vAny/CoverageData/_MasterCommander.864243456/Snapshot/snapshot.utdcvr</s:String>


Expand Down
2 changes: 1 addition & 1 deletion docs/master-commander/CmdOptionsBase.ToArguments().md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public System.Collections.Generic.IEnumerable<string> ToArguments();

#### Returns
[System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')
An enumerable of strings representing the command line arguments.
A strings enumerable representing the command line arguments.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Additional arguments to include in the result.

#### Returns
[System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')
An enumerable of strings representing the command line arguments.
A strings enumerable representing the command line arguments.
6 changes: 3 additions & 3 deletions src/library/MasterCommander/Core/CmdOptionsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract record CmdOptionsBase(params string[] InitialArguments)
/// Converts the properties of the command options into an enumerable of argument strings.
/// </summary>
/// <param name="additionalArguments">Additional arguments to include in the result.</param>
/// <returns>An enumerable of strings representing the command line arguments.</returns>
/// <returns>A strings enumerable representing the command line arguments.</returns>
public IEnumerable<string> ToArguments(params string[] additionalArguments)
{
var arguments = ToArguments();
Expand All @@ -25,7 +25,7 @@ public IEnumerable<string> ToArguments(params string[] additionalArguments)
/// <summary>
/// Converts the properties of the command options into an enumerable of argument strings.
/// </summary>
/// <returns>An enumerable of strings representing the command line arguments.</returns>
/// <returns>A strings enumerable representing the command line arguments.</returns>
public IEnumerable<string> ToArguments()
{
var arguments = new List<string>(InitialArguments);
Expand Down Expand Up @@ -85,7 +85,7 @@ public IEnumerable<string> ToArguments()
/// <param name="cmdOptionValues">The attribute specifying valid values, if present.</param>
private static void ValidatePropertyValue(PropertyInfo property, object value, CmdOptionValuesAttribute? cmdOptionValues)
{
if (cmdOptionValues != null && !cmdOptionValues.ValidOptions.Contains(value.ToString()))
if (cmdOptionValues?.ValidOptions.Contains(value.ToString()) == false)
{
throw new ArgumentException($"Invalid value for {property.Name}. Valid options are: {string.Join(", ", cmdOptionValues.ValidOptions)}");
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/MasterCommander.Tests/CmdOptionsBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void ToArguments_ShouldNotIncludeFalseBooleans()
};

// Act
var args = options.ToArguments();
var args = options.ToArguments().ToList();

// Assert
string[] unexpected = ["--dry-run", "--no-update-check", "--diagnostics"];
Expand Down
2 changes: 1 addition & 1 deletion src/tests/MasterCommander.Tests/DotnetNewOptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void ToArguments_ShouldOmitOptionalArguments_WhenNotSet()
var options = new DotnetNewOptions("console");

// Act
var args = options.ToArguments();
var args = options.ToArguments().ToList();

// Assert
args.Should().ContainInOrder("new", "console");
Expand Down
1 change: 0 additions & 1 deletion src/tests/MasterCommander.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@

global using FluentAssertions;
global using MasterCommander.Core;
global using Xunit;

0 comments on commit 46398c3

Please sign in to comment.