Skip to content

Commit 77f9076

Browse files
committed
拼写错误检查
1 parent fa9187e commit 77f9076

File tree

47 files changed

+160
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+160
-190
lines changed

WebApiClientCore.Abstractions/ApiDataTypeDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public abstract class ApiDataTypeDescriptor
2323
public abstract bool IsRawStream { get; protected set; }
2424

2525
/// <summary>
26-
/// 获取是否为原始类型的byte[]
26+
/// 获取是否为原始类型的 byte[]
2727
/// </summary>
2828
public abstract bool IsRawByteArray { get; protected set; }
2929

WebApiClientCore.Abstractions/Contexts/ApiRequestContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace WebApiClientCore
99
public class ApiRequestContext
1010
{
1111
/// <summary>
12-
/// 获取http上下文
12+
/// 获取 http 上下文
1313
/// </summary>
1414
public HttpContext HttpContext { get; }
1515

WebApiClientCore.Abstractions/Contexts/HttpContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace WebApiClientCore
66
{
77
/// <summary>
8-
/// 表示http上下文
8+
/// 表示 http 上下文
99
/// </summary>
1010
public class HttpContext : HttpClientContext
1111
{

WebApiClientCore.Abstractions/HttpApiOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class HttpApiOptions
1717
{
1818
/// <summary>
1919
/// 获取或设置Http服务完整主机域名
20-
/// 例如http://www.abc.com/或http://www.abc.com/path/
20+
/// 例如 http://www.abc.com/ 或 http://www.abc.com/path/
2121
/// 设置了HttpHost值,HttpHostAttribute将失效
2222
/// </summary>
2323
public Uri? HttpHost { get; set; }
@@ -45,12 +45,12 @@ public class HttpApiOptions
4545

4646

4747
/// <summary>
48-
/// 获取json序列化选项
48+
/// 获取 json 序列化选项
4949
/// </summary>
5050
public JsonSerializerOptions JsonSerializeOptions { get; } = CreateJsonSerializeOptions();
5151

5252
/// <summary>
53-
/// 获取json反序列化选项
53+
/// 获取 json 反序列化选项
5454
/// </summary>
5555
public JsonSerializerOptions JsonDeserializeOptions { get; } = CreateJsonDeserializeOptions();
5656

@@ -65,7 +65,7 @@ public class HttpApiOptions
6565
public XmlReaderSettings XmlDeserializeOptions { get; } = new XmlReaderSettings();
6666

6767
/// <summary>
68-
/// 获取keyValue序列化选项
68+
/// 获取 keyValue 序列化选项
6969
/// </summary>
7070
public KeyValueSerializerOptions KeyValueSerializeOptions { get; } = new KeyValueSerializerOptions();
7171

WebApiClientCore.Abstractions/HttpApiRequestMessage.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
namespace WebApiClientCore
99
{
1010
/// <summary>
11-
/// 表示httpApi的请求消息
11+
/// 表示 httpApi 的请求消息
1212
/// </summary>
1313
public abstract class HttpApiRequestMessage : HttpRequestMessage
1414
{
1515
/// <summary>
16-
/// 返回使用uri值合成的请求URL
16+
/// 返回使用 uri 值合成的请求URL
1717
/// </summary>
1818
/// <param name="uri">uri值</param>
1919
/// <returns></returns>
@@ -29,7 +29,7 @@ public abstract class HttpApiRequestMessage : HttpRequestMessage
2929

3030
/// <summary>
3131
/// 添加字段到已有的Content
32-
/// 要求content-type为application/x-www-form-urlencoded
32+
/// 要求 content-type 为 application/x-www-form-urlencoded
3333
/// </summary>
3434
/// <param name="name">名称</param>
3535
/// <param name="value">值</param>
@@ -42,7 +42,7 @@ public async Task AddFormFieldAsync(string name, string? value)
4242

4343
/// <summary>
4444
/// 添加字段到已有的Content
45-
/// 要求content-type为application/x-www-form-urlencoded
45+
/// 要求 content-type 为 application/x-www-form-urlencoded
4646
/// </summary>
4747
/// <param name="keyValues">键值对</param>
4848
/// <exception cref="NotSupportedException"></exception>
@@ -52,7 +52,7 @@ public async Task AddFormFieldAsync(string name, string? value)
5252

5353
/// <summary>
5454
/// 添加文本内容到已有的Content
55-
/// 要求content-type为multipart/form-data
55+
/// 要求 content-type 为 multipart/form-data
5656
/// </summary>
5757
/// <param name="name">名称</param>
5858
/// <param name="value">文本</param>
@@ -64,14 +64,14 @@ public void AddFormDataText(string name, string? value)
6464

6565
/// <summary>
6666
/// 添加文本内容到已有的Content
67-
/// 要求content-type为multipart/form-data
67+
/// 要求 content-type 为 multipart/form-data
6868
/// </summary>
6969
/// <param name="keyValues">键值对</param>
7070
public abstract void AddFormDataText(IEnumerable<KeyValue> keyValues);
7171

7272
/// <summary>
7373
/// 添加文件内容到已有的Content
74-
/// 要求content-type为multipart/form-data
74+
/// 要求 content-type 为 multipart/form-data
7575
/// </summary>
7676
/// <param name="stream">文件流</param>
7777
/// <param name="name">名称</param>

WebApiClientCore.Abstractions/IDataCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface IDataCollection
1313
int Count { get; }
1414

1515
/// <summary>
16-
/// 返回是否包含指定的key
16+
/// 返回是否包含指定的 key
1717
/// </summary>
1818
/// <param name="key">键</param>
1919
/// <returns></returns>
@@ -28,7 +28,7 @@ public interface IDataCollection
2828

2929
/// <summary>
3030
/// 读取指定的键并尝试转换为目标类型
31-
/// 失败则返回目标类型的default值
31+
/// 失败则返回目标类型的 default 值
3232
/// </summary>
3333
/// <typeparam name="TValue"></typeparam>
3434
/// <param name="key">键</param>

WebApiClientCore.Abstractions/Serialization/KeyValueSerializerOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace WebApiClientCore.Serialization
1414
public sealed class KeyValueSerializerOptions : KeyNamingOptions
1515
{
1616
/// <summary>
17-
/// 包装的jsonOptions
17+
/// 包装的 jsonOptions
1818
/// </summary>
1919
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
2020
private readonly JsonSerializerOptions jsonOptions;
@@ -37,7 +37,7 @@ public JsonNamingPolicy? DictionaryKeyPolicy
3737
}
3838

3939
/// <summary>
40-
/// 获取或设置是否忽略null值
40+
/// 获取或设置是否忽略 null 值
4141
/// </summary>
4242
public bool IgnoreNullValues
4343
{

WebApiClientCore.Analyzers/Descriptors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static class Descriptors
2828
/// <summary>
2929
/// 非方法声明诊断描述器
3030
/// </summary>
31-
public static DiagnosticDescriptor NotMethodDefindedDescriptor { get; }
31+
public static DiagnosticDescriptor NotMethodDefendedDescriptor { get; }
3232
= Create("WA1004", Resx.WA1004_title, Resx.WA1004_message);
3333

3434
/// <summary>

WebApiClientCore.Analyzers/HttpApiContext.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ public static bool TryParse(SyntaxNodeAnalysisContext syntaxNodeContext, out Htt
8484
return false;
8585
}
8686

87-
var ihttpApi = syntaxNodeContext.Compilation.GetTypeByMetadataName(IHttpApiTypeName);
88-
if (ihttpApi == null)
87+
var httpApi = syntaxNodeContext.Compilation.GetTypeByMetadataName(IHttpApiTypeName);
88+
if (httpApi == null)
8989
{
9090
return false;
9191
}
9292

93-
var iapiAttribute = syntaxNodeContext.Compilation.GetTypeByMetadataName(IApiAttributeTypeName);
94-
if (IsHttpApiInterface(@interface, ihttpApi, iapiAttribute) == false)
93+
var apiAttribute = syntaxNodeContext.Compilation.GetTypeByMetadataName(IApiAttributeTypeName);
94+
if (IsHttpApiInterface(@interface, httpApi, apiAttribute) == false)
9595
{
9696
return false;
9797
}
@@ -105,27 +105,27 @@ public static bool TryParse(SyntaxNodeAnalysisContext syntaxNodeContext, out Htt
105105
}
106106

107107
/// <summary>
108-
/// 是否为http接口
108+
/// 是否为 http 接口
109109
/// </summary>
110110
/// <param name="interface"></param>
111-
/// <param name="ihttpApi"></param>
112-
/// <param name="iapiAttribute"></param>
111+
/// <param name="httpApi"></param>
112+
/// <param name="apiAttribute"></param>
113113
/// <returns></returns>
114-
private static bool IsHttpApiInterface(INamedTypeSymbol @interface, INamedTypeSymbol ihttpApi, INamedTypeSymbol? iapiAttribute)
114+
private static bool IsHttpApiInterface(INamedTypeSymbol @interface, INamedTypeSymbol httpApi, INamedTypeSymbol? apiAttribute)
115115
{
116-
if (@interface.AllInterfaces.Contains(ihttpApi))
116+
if (@interface.AllInterfaces.Contains(httpApi))
117117
{
118118
return true;
119119
}
120120

121-
if (iapiAttribute == null)
121+
if (apiAttribute == null)
122122
{
123123
return false;
124124
}
125125

126126
return @interface.AllInterfaces.Append(@interface).Any(i =>
127-
HasAttribute(i, iapiAttribute) || i.GetMembers().OfType<IMethodSymbol>().Any(m =>
128-
HasAttribute(m, iapiAttribute) || m.Parameters.Any(p => HasAttribute(p, iapiAttribute))));
127+
HasAttribute(i, apiAttribute) || i.GetMembers().OfType<IMethodSymbol>().Any(m =>
128+
HasAttribute(m, apiAttribute) || m.Parameters.Any(p => HasAttribute(p, apiAttribute))));
129129
}
130130

131131

WebApiClientCore.Analyzers/HttpApiDiagnosticAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
2525
Descriptors.AttributeDescriptor,
2626
Descriptors.ReturnTypeDescriptor,
2727
Descriptors.RefParameterDescriptor,
28-
Descriptors.NotMethodDefindedDescriptor,
28+
Descriptors.NotMethodDefendedDescriptor,
2929
Descriptors.GenericMethodDescriptor,
3030
Descriptors.UriAttributeDescriptor,
3131
Descriptors.ModifierDescriptor,
@@ -70,7 +70,7 @@ private IEnumerable<HttpApiDiagnosticProvider> GetDiagnosticProviders(HttpApiCon
7070
yield return new CtorAttributeDiagnosticProvider(context);
7171
yield return new ReturnTypeDiagnosticProvider(context);
7272
yield return new RefParameterDiagnosticProvider(context);
73-
yield return new NotMethodDefindedDiagnosticProvider(context);
73+
yield return new NotMethodDefendedDiagnosticProvider(context);
7474
yield return new GenericMethodDiagnosticProvider(context);
7575
yield return new UriAttributeDiagnosticProvider(context);
7676
yield return new ModifierDiagnosticProvider(context);

0 commit comments

Comments
 (0)