-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add documentation for IDE0360, IDE0370, and IDE0380 code style rules #49681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation for three new IDE code analysis rules: IDE0360 (Simplify property accessor), IDE0370 (Remove unnecessary suppression), and IDE0380 (Remove unnecessary 'unsafe' modifier). The changes include new rule documentation files, table of contents updates, and index file updates.
Key changes:
- Three new rule documentation files with examples and configuration guidance.
- Updates to the TOC to include navigation links for the new rules.
- Updates to index and language-rules files to list the new rules in appropriate categories.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/navigate/tools-diagnostics/toc.yml | Adds TOC entries for IDE0360, IDE0370, and IDE0380 |
| docs/fundamentals/code-analysis/style-rules/language-rules.md | Adds references to the new rules in appropriate categories and updates the ms.date |
| docs/fundamentals/code-analysis/style-rules/index.md | Adds table entries for the three new rules with their options |
| docs/fundamentals/code-analysis/style-rules/ide0380.md | New documentation for Remove unnecessary 'unsafe' modifier rule |
| docs/fundamentals/code-analysis/style-rules/ide0370.md | New documentation for Remove unnecessary suppression rule |
| docs/fundamentals/code-analysis/style-rules/ide0360.md | New documentation for Simplify property accessor rule |
|
|
||
| C# style rules: | ||
|
|
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate section header 'C# style rules:' appears immediately after the .NET style rules section. This creates an incorrect document structure with two separate 'C# style rules:' sections under the same 'Suppression preferences' category. Remove this duplicate header and merge the IDE0370 entry into the existing 'C# style rules:' list on line 264, or if it should be separate, add a descriptive subheading to explain why.
| C# style rules: |
|
|
||
| C# style rules: | ||
|
|
||
| - [Remove unnecessary suppression (IDE0370)](ide0370.md) |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IDE0370 entry is placed under the 'Suppression preferences' section, but the entry text 'Remove unnecessary suppression' is identical to IDE0079. Consider adding clarifying text to distinguish between the two rules, such as 'Remove unnecessary suppression (null-forgiving operator)' to indicate that IDE0370 specifically handles the ! operator, while IDE0079 handles pragma and SuppressMessage suppressions.
| - [Remove unnecessary suppression (IDE0370)](ide0370.md) | |
| - [Remove unnecessary suppression (null-forgiving operator) (IDE0370)](ide0370.md) |
Summary
Adds documentation for three new code style rules from the Roslyn repository.
Contributes to #48865.
Files Created
ide0360.md - Simplify property accessor (C# 13+)
fieldkeyword:get { return field; }→get;csharp_style_prefer_simple_property_accessorside0370.md - Remove unnecessary suppression
object o = ""!;→object o = "";ide0380.md - Remove unnecessary 'unsafe' modifier
unsafemodifier when no pointer operations presentFiles Modified
All documentation follows existing patterns with proper frontmatter, metadata tables, examples from Roslyn tests, and suppression guidance.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Internal previews
unsafemodifier (IDE0380)