Skip to content

Commit

Permalink
chore: rename namespace and add NamespaceLinter
Browse files Browse the repository at this point in the history
  • Loading branch information
moomiji committed Jan 2, 2024
1 parent bc6f874 commit 6904bc1
Show file tree
Hide file tree
Showing 58 changed files with 180 additions and 116 deletions.
5 changes: 2 additions & 3 deletions src/MaaFramework.Binding.Grpc/Abstractions/MaaCommonGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using MaaFramework.Binding.Interop.Grpc;

namespace MaaFramework.Binding.Grpc.Abstractions;
namespace MaaFramework.Binding.Abstractions.Grpc;

/// <summary>
/// An abstract class providing common members for <see cref="MaaControllerGrpc"/>, <see cref="MaaInstanceGrpc"/> and <see cref="MaaResourceGrpc"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Grpc.Net.Client;

namespace MaaFramework.Binding.Grpc.Abstractions;
namespace MaaFramework.Binding.Abstractions.Grpc;

/// <summary>
/// An abstract class providing common members for GrpcChannel.
Expand Down
6 changes: 3 additions & 3 deletions src/MaaFramework.Binding.Grpc/Buffers/MaaImageBufferGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Grpc.Net.Client;
using MaaFramework.Binding.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using MaaFramework.Binding.Interop.Grpc;
using System.Buffers;
using static MaaFramework.Binding.Grpc.Interop.Image;
using static MaaFramework.Binding.Interop.Grpc.Image;

namespace MaaFramework.Binding.Buffers;

/// <summary>
/// A class providing a reference implementation for Maa Image Buffer section of <see cref="MaaFramework.Binding.Grpc.Interop.Image"/>.
/// A class providing a reference implementation for Maa Image Buffer section of <see cref="MaaFramework.Binding.Interop.Grpc.Image"/>.
/// </summary>
public class MaaImageBufferGrpc : MaaDisposableHandle<string>, IMaaImageBuffer<string>
{
Expand Down
4 changes: 2 additions & 2 deletions src/MaaFramework.Binding.Grpc/MaaAdbControllerGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Grpc.Net.Client;
using MaaFramework.Binding.Grpc.Interop;
using static MaaFramework.Binding.Grpc.Interop.Controller;
using MaaFramework.Binding.Interop.Grpc;
using static MaaFramework.Binding.Interop.Grpc.Controller;

namespace MaaFramework.Binding;

Expand Down
8 changes: 4 additions & 4 deletions src/MaaFramework.Binding.Grpc/MaaControllerGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Abstractions.Grpc;
using MaaFramework.Binding.Buffers;
using MaaFramework.Binding.Grpc.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using static MaaFramework.Binding.Grpc.Interop.Controller;
using MaaFramework.Binding.Interop.Grpc;
using static MaaFramework.Binding.Interop.Grpc.Controller;

namespace MaaFramework.Binding;

/// <summary>
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Grpc.Interop.Controller"/>.
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Interop.Grpc.Controller"/>.
/// </summary>
public class MaaControllerGrpc : MaaCommonGrpc, IMaaController<string>
{
Expand Down
4 changes: 2 additions & 2 deletions src/MaaFramework.Binding.Grpc/MaaCustomControllerGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using Grpc.Net.Client;
using MaaFramework.Binding.Buffers;
using MaaFramework.Binding.Custom;
using MaaFramework.Binding.Grpc.Interop;
using static MaaFramework.Binding.Grpc.Interop.Controller;
using MaaFramework.Binding.Interop.Grpc;
using static MaaFramework.Binding.Interop.Grpc.Controller;

namespace MaaFramework.Binding;

Expand Down
8 changes: 4 additions & 4 deletions src/MaaFramework.Binding.Grpc/MaaInstanceGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Abstractions.Grpc;
using MaaFramework.Binding.Buffers;
using MaaFramework.Binding.Custom;
using MaaFramework.Binding.Grpc.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using MaaFramework.Binding.Interop.Grpc;
using System.Diagnostics.CodeAnalysis;
using static MaaFramework.Binding.Grpc.Interop.Instance;
using static MaaFramework.Binding.Interop.Grpc.Instance;

namespace MaaFramework.Binding;

/// <summary>
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Grpc.Interop.Instance"/>.
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Interop.Grpc.Instance"/>.
/// </summary>
public class MaaInstanceGrpc : MaaCommonGrpc, IMaaInstance<string>
{
Expand Down
8 changes: 4 additions & 4 deletions src/MaaFramework.Binding.Grpc/MaaResourceGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Grpc.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using static MaaFramework.Binding.Grpc.Interop.Resource;
using MaaFramework.Binding.Abstractions.Grpc;
using MaaFramework.Binding.Interop.Grpc;
using static MaaFramework.Binding.Interop.Grpc.Resource;

namespace MaaFramework.Binding;

/// <summary>
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Grpc.Interop.Resource"/>.
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Interop.Grpc.Resource"/>.
/// </summary>
public class MaaResourceGrpc : MaaCommonGrpc, IMaaResource<string>
{
Expand Down
8 changes: 4 additions & 4 deletions src/MaaFramework.Binding.Grpc/MaaSyncContextGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Abstractions.Grpc;
using MaaFramework.Binding.Buffers;
using MaaFramework.Binding.Grpc.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using MaaFramework.Binding.Interop.Grpc;
using System.Diagnostics.CodeAnalysis;
using static MaaFramework.Binding.Grpc.Interop.SyncContext;
using static MaaFramework.Binding.Interop.Grpc.SyncContext;

namespace MaaFramework.Binding;

/// <summary>
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Grpc.Interop.SyncContext"/>.
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Interop.Grpc.SyncContext"/>.
/// </summary>
public class MaaSyncContextGrpc : MaaGrpcChannel, IMaaSyncContext<string>
{
Expand Down
10 changes: 5 additions & 5 deletions src/MaaFramework.Binding.Grpc/MaaToolKitGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Grpc.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using static MaaFramework.Binding.Grpc.Interop.Config;
using static MaaFramework.Binding.Grpc.Interop.Device;
using MaaFramework.Binding.Abstractions.Grpc;
using MaaFramework.Binding.Interop.Grpc;
using static MaaFramework.Binding.Interop.Grpc.Config;
using static MaaFramework.Binding.Interop.Grpc.Device;

namespace MaaFramework.Binding;

/// <summary>
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Grpc.Interop.Config"/> and <see cref="MaaFramework.Binding.Grpc.Interop.Device"/>.
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Interop.Grpc.Config"/> and <see cref="MaaFramework.Binding.Interop.Grpc.Device"/>.
/// </summary>
public class MaaToolKitGrpc : MaaGrpcChannel, IMaaToolkit
{
Expand Down
8 changes: 4 additions & 4 deletions src/MaaFramework.Binding.Grpc/MaaUtilityGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Grpc.Core;
using Grpc.Net.Client;
using MaaFramework.Binding.Grpc.Abstractions;
using MaaFramework.Binding.Grpc.Interop;
using MaaFramework.Binding.Abstractions.Grpc;
using MaaFramework.Binding.Interop.Grpc;
using System.Diagnostics.CodeAnalysis;
using static MaaFramework.Binding.Grpc.Interop.Utility;
using static MaaFramework.Binding.Interop.Grpc.Utility;

namespace MaaFramework.Binding;

/// <summary>
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Grpc.Interop.Utility"/>.
/// A wrapper class providing a reference implementation for <see cref="MaaFramework.Binding.Interop.Grpc.Utility"/>.
/// </summary>
public class MaaUtilityGrpc : MaaGrpcChannel, IMaaUtility
{
Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/buffer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/controller.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/device.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/instance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/sync.context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

message Point {
optional int32 x = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.Grpc/Protos/utility.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package maarpc;

option csharp_namespace = "MaaFramework.Binding.Grpc.Interop";
option csharp_namespace = "MaaFramework.Binding.Interop.Grpc";

import "types.proto";

Expand Down
5 changes: 2 additions & 3 deletions src/MaaFramework.Binding.Native/Abstractions/MaaCommon.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using MaaFramework.Binding.Abstractions;
using MaaFramework.Binding.Native.Interop;
using MaaFramework.Binding.Interop.Native;

namespace MaaFramework.Binding.Native.Abstractions;
namespace MaaFramework.Binding.Abstractions.Native;

/// <summary>
/// An abstract class providing common members for <see cref="MaaController"/>, <see cref="MaaInstance"/> and <see cref="MaaResource"/>.
Expand Down
6 changes: 3 additions & 3 deletions src/MaaFramework.Binding.Native/Buffers/MaaImageBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using MaaFramework.Binding.Abstractions;
using MaaFramework.Binding.Native.Interop;
using static MaaFramework.Binding.Native.Interop.MaaBuffer;
using MaaFramework.Binding.Interop.Native;
using static MaaFramework.Binding.Interop.Native.MaaBuffer;

namespace MaaFramework.Binding.Buffers;

/// <summary>
/// A class providing a reference implementation for Maa Image Buffer section of <see cref="MaaFramework.Binding.Native.Interop.MaaBuffer"/>.
/// A class providing a reference implementation for Maa Image Buffer section of <see cref="MaaFramework.Binding.Interop.Native.MaaBuffer"/>.
/// </summary>
public class MaaImageBuffer : MaaDisposableHandle<nint>, IMaaImageBuffer<nint>
{
Expand Down
6 changes: 3 additions & 3 deletions src/MaaFramework.Binding.Native/Buffers/MaaRectBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using MaaFramework.Binding.Abstractions;
using MaaFramework.Binding.Native.Interop;
using static MaaFramework.Binding.Native.Interop.MaaBuffer;
using MaaFramework.Binding.Interop.Native;
using static MaaFramework.Binding.Interop.Native.MaaBuffer;

namespace MaaFramework.Binding.Buffers;

/// <summary>
/// A class providing a reference implementation for Maa Rect Buffer section of <see cref="MaaFramework.Binding.Native.Interop.MaaBuffer"/>.
/// A class providing a reference implementation for Maa Rect Buffer section of <see cref="MaaFramework.Binding.Interop.Native.MaaBuffer"/>.
/// </summary>
public class MaaRectBuffer : MaaDisposableHandle<nint>, IMaaRectBuffer<nint>
{
Expand Down
6 changes: 3 additions & 3 deletions src/MaaFramework.Binding.Native/Buffers/MaaStringBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using MaaFramework.Binding.Abstractions;
using MaaFramework.Binding.Native.Interop;
using static MaaFramework.Binding.Native.Interop.MaaBuffer;
using MaaFramework.Binding.Interop.Native;
using static MaaFramework.Binding.Interop.Native.MaaBuffer;

namespace MaaFramework.Binding.Buffers;

/// <summary>
/// A class providing a reference implementation for Maa String Buffer section of <see cref="MaaFramework.Binding.Native.Interop.MaaBuffer"/>.
/// A class providing a reference implementation for Maa String Buffer section of <see cref="MaaFramework.Binding.Interop.Native.MaaBuffer"/>.
/// </summary>
public class MaaStringBuffer : MaaDisposableHandle<nint>, IMaaStringBuffer<nint>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
8 changes: 4 additions & 4 deletions src/MaaFramework.Binding.Native/Interop/Framework/MaaDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
global using MaaTransparentArg = nint;
global using MaaCallbackTransparentArg = nint;

global using MaaResourceCallback = MaaFramework.Binding.Native.Interop.MaaAPICallback;
global using MaaControllerCallback = MaaFramework.Binding.Native.Interop.MaaAPICallback;
global using MaaInstanceCallback = MaaFramework.Binding.Native.Interop.MaaAPICallback;
global using MaaResourceCallback = MaaFramework.Binding.Interop.Native.MaaAPICallback;
global using MaaControllerCallback = MaaFramework.Binding.Interop.Native.MaaAPICallback;
global using MaaInstanceCallback = MaaFramework.Binding.Interop.Native.MaaAPICallback;

global using MaaCustomControllerHandle = nint;
global using MaaCustomRecognizerHandle = nint;
Expand All @@ -65,7 +65,7 @@
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CA1707 // 标识符不应包含下划线

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

public static class MaaDef
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Runtime.InteropServices;

namespace MaaFramework.Binding.Native.Interop;
namespace MaaFramework.Binding.Interop.Native;

#pragma warning disable S1133 // Deprecated code should be removed
#pragma warning disable S4200 // Native methods should be wrapped
Expand Down
Loading

0 comments on commit 6904bc1

Please sign in to comment.