Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
style: cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdayo committed May 9, 2023
1 parent c9e4013 commit b09c240
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
Expand Up @@ -49,4 +49,3 @@ public static void AddOneBot(this IAdapterCollection adapters, OneBotAdapterConf
adapters.Add(new OneBotAdapter(config));
}
}

2 changes: 1 addition & 1 deletion src/Flandre.Framework/Common/CommandParseResult.cs
Expand Up @@ -9,7 +9,7 @@ public sealed class CommandParseResult
/// 参数解析结果
/// </summary>
public List<object?> ParsedArguments { get; } = new();

/// <summary>
/// 选项解析结果(选项名-值)
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Flandre.Framework/Common/DefaultCommandParser.cs
Expand Up @@ -7,12 +7,12 @@ namespace Flandre.Framework.Common;
internal class DefaultCommandParser : ICommandParser
{
private readonly CommandService _service;

public DefaultCommandParser(CommandService service)
{
_service = service;
}

/// <summary>
/// 解析指令文本的参数及选项部分
/// </summary>
Expand Down
5 changes: 3 additions & 2 deletions tests/Flandre.Framework.Tests/CommandTests.cs
Expand Up @@ -29,7 +29,8 @@ public static MessageContent Test1(bool arg1, [Option] double opt = 0)
[Command("test2", "..test111.11...45.14.")]
[Obsolete("This command is obsoleted.")]
public static string Test2(int arg1, float arg2, CommandContext ctx,
[Option] bool opt1 = true, [Option(ShortName = 'o')] bool opt2 = false)
[Option]
bool opt1 = true, [Option(ShortName = 'o')] bool opt2 = false)
{
return $"{arg1} {arg2} {opt1} {opt2}";
}
Expand Down Expand Up @@ -91,7 +92,7 @@ public async Task TestCommands()

await app.StartWithDefaultsAsync();

Assert.Equal(7, service.RootCommandNode.CountCommands());
Assert.Equal(7, service.RootCommandNode.CountCommands());

MessageContent? content;

Expand Down
4 changes: 1 addition & 3 deletions tests/Flandre.Framework.Tests/SessionTests.cs
@@ -1,6 +1,4 @@
using Flandre.Framework.Extensions;

namespace Flandre.Framework.Tests;
namespace Flandre.Framework.Tests;

public class SessionTests
{
Expand Down

0 comments on commit b09c240

Please sign in to comment.