docs(diagnostic): 更新诊断消息描述文本#124
Merged
Merged
Conversation
- 为 Priority 特性错误消息添加句号结尾 - 为接口实现警告消息添加句号结尾 - 为 partial 类要求错误消息添加句号结尾 - 为整数值验证错误消息添加句号结尾 - 为嵌套类限制错误消息添加句号结尾 - 为服务获取建议消息添加句号结尾 - 在测试项目配置中添加警告级别设置
审阅者指南(在小型 PR 上折叠显示)审阅者指南为与 Priority 相关的分析器统一诊断描述文本的标点符号,并调整测试项目配置以包含警告级别设置。 文件级变更
技巧与命令与 Sourcery 交互
自定义你的使用体验访问你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideStandardizes diagnostic description text punctuation for Priority-related analyzers and adjusts test project configuration to include a warning-level setting. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| C# | Mar 21, 2026 12:47p.m. | Review ↗ | |
| Secrets | Mar 21, 2026 12:47p.m. | Review ↗ |
There was a problem hiding this comment.
Hey - 我发现了 5 个问题,并给出了一些总体反馈:
- 更新后的诊断描述现在以中文句号加英文句号结尾(。.),看起来像是无意的重复标点;建议在所有消息中统一只使用一种标点风格。
AI 代理使用的提示词
Please address the comments from this code review:
## Overall Comments
- The updated diagnostic descriptions now end with a Chinese full stop followed by an English period (。.), which looks like accidental double punctuation; consider using only one style consistently across all messages.
## Individual Comments
### Comment 1
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="19-25" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。"
+ description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。."
);
</code_context>
<issue_to_address>
**issue (typo):** 描述字符串在全角中文句号后面似乎多了一个英文句号。
当前描述以 `。.` 结尾。请移除最后的 `.`,让它只以一个句号结尾(例如:`不支持其他类型。`)。
```suggestion
category: Category,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。"
);
/// <summary>
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
/// <summary>
```
</issue_to_address>
### Comment 2
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="35" />
<code_context>
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
- description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
+ description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。."
);
</code_context>
<issue_to_address>
**issue (typo):** 该描述末尾的重复标点 `。.` 看起来像是拼写错误。
请移除末尾的 ASCII `.`,只以中文句号结尾,以在面向用户的诊断消息中保持一致性。
建议实现:
```csharp
isEnabledByDefault: true,
description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。"
);
```
```csharp
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>
### Comment 3
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="48" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "源生成器需要在 partial 类中生成 IPrioritized 接口实现。"
+ description: "源生成器需要在 partial 类中生成 IPrioritized 接口实现。."
);
</code_context>
<issue_to_address>
**issue (typo):** 描述字符串以 `。.` 结尾,看起来并非有意为之。
请只使用一种句子结束符(`。` 或 `.` 二选一),以与其他诊断消息保持一致。
建议实现:
```csharp
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
```csharp
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>
### Comment 4
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="61" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "Priority 特性必须提供一个有效的整数值。"
+ description: "Priority 特性必须提供一个有效的整数值。."
);
</code_context>
<issue_to_address>
**issue (typo):** 消息末尾出现 `。.`,可能是标点错误。
请移除末尾的 `.`,让诊断文本仅以 `。` 字符结尾。
建议实现:
```csharp
isEnabledByDefault: true,
description: "源生成器需要在 partial 类中生成 IPrioritized 接口实现。"
);
```
```csharp
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>
### Comment 5
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="74" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "Priority 特性仅支持顶层类,不支持嵌套类。请将嵌套类移至命名空间级别。"
+ description: "Priority 特性仅支持顶层类,不支持嵌套类。请将嵌套类移至命名空间级别。."
);
</code_context>
<issue_to_address>
**issue (typo):** 该较长描述中末尾的 `。.` 序列很可能是无意的。
请在最后一个全角中文句号 `。` 之后移除 ASCII `.`,以避免在工具中显示为多余句点、像是拼写错误。
建议实现:
```csharp
isEnabledByDefault: true,
description: "Priority 特性必须提供一个有效的整数值。"
);
```
```csharp
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've found 5 issues, and left some high level feedback:
- The updated diagnostic descriptions now end with a Chinese full stop followed by an English period (。.), which looks like accidental double punctuation; consider using only one style consistently across all messages.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The updated diagnostic descriptions now end with a Chinese full stop followed by an English period (。.), which looks like accidental double punctuation; consider using only one style consistently across all messages.
## Individual Comments
### Comment 1
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="19-25" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。"
+ description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。."
);
</code_context>
<issue_to_address>
**issue (typo):** The description string appears to have an extra period after the full-width Chinese full stop.
The description now ends with `。.`. Please remove the trailing `.` so it ends with a single full stop (e.g., `不支持其他类型。`).
```suggestion
category: Category,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。"
);
/// <summary>
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
/// <summary>
```
</issue_to_address>
### Comment 2
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="35" />
<code_context>
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
- description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
+ description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。."
);
</code_context>
<issue_to_address>
**issue (typo):** Double punctuation `。.` at the end of this description likely reads as a typo.
Please remove the trailing ASCII `.` and end the sentence with just the Chinese full stop for consistency in user-facing diagnostics.
Suggested implementation:
```csharp
isEnabledByDefault: true,
description: "Priority 特性设计用于类级别的优先级标记,不支持其他类型。"
);
```
```csharp
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>
### Comment 3
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="48" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "源生成器需要在 partial 类中生成 IPrioritized 接口实现。"
+ description: "源生成器需要在 partial 类中生成 IPrioritized 接口实现。."
);
</code_context>
<issue_to_address>
**issue (typo):** Description string ends with `。.`, which seems unintended.
Please use only one sentence terminator here (either `。` or `.`) to be consistent with the other diagnostics.
Suggested implementation:
```csharp
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
```csharp
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>
### Comment 4
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="61" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "Priority 特性必须提供一个有效的整数值。"
+ description: "Priority 特性必须提供一个有效的整数值。."
);
</code_context>
<issue_to_address>
**issue (typo):** Potential punctuation typo with `。.` at the end of the message.
Remove the trailing `.` so the message ends with just the `。` character in the diagnostic text.
Suggested implementation:
```csharp
isEnabledByDefault: true,
description: "源生成器需要在 partial 类中生成 IPrioritized 接口实现。"
);
```
```csharp
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>
### Comment 5
<location path="GFramework.SourceGenerators/Diagnostics/PriorityDiagnostic.cs" line_range="74" />
<code_context>
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "Priority 特性仅支持顶层类,不支持嵌套类。请将嵌套类移至命名空间级别。"
+ description: "Priority 特性仅支持顶层类,不支持嵌套类。请将嵌套类移至命名空间级别。."
);
</code_context>
<issue_to_address>
**issue (typo):** The final `。.` sequence in this longer description is likely accidental.
Please remove the trailing ASCII `.` after the final full-width `。` to avoid an unintended double period that may appear as a typo in tooling.
Suggested implementation:
```csharp
isEnabledByDefault: true,
description: "Priority 特性必须提供一个有效的整数值。"
);
```
```csharp
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: "当类已经手动实现 IPrioritized 接口时,源生成器将跳过代码生成以避免冲突。"
);
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- 移除了 Priority 特性描述中的多余句号 - 移除了 IPrioritized 接口实现跳过警告中的多余句号 - 移除了 partial 类要求错误中的多余句号 - 移除了 Priority 特性值验证错误中的多余句号 - 移除了嵌套类限制错误中的多余句号 - 移除了服务获取建议信息中的多余句号
This was referenced Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
标准化诊断消息描述,并调整测试项目的编译器警告配置。
增强内容:
测试:
Original summary in English
Summary by Sourcery
Standardize diagnostic message descriptions and adjust test project compiler warning configuration.
Enhancements:
Tests: