Document dotnet_prefer_system_hash_code (IDE0070) and new IDE0221 rule#52975
Merged
Document dotnet_prefer_system_hash_code (IDE0070) and new IDE0221 rule#52975
Conversation
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/82c6227c-987d-4e2f-b328-93dbb11c0d26 Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Document new EditorConfig style rules
Document dotnet_prefer_system_hash_code (IDE0070) and new IDE0221 rule
Apr 10, 2026
gewarren
approved these changes
Apr 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the .NET code style rules documentation to cover two newly introduced EditorConfig options, including adding a new rule reference page for IDE0221 and documenting the previously-undocumented option for IDE0070.
Changes:
- Documented the
dotnet_prefer_system_hash_codeoption for IDE0070 and linked it from the style rules index. - Added a new reference page for IDE0221, including option details and examples.
- Wired IDE0221 into the relevant navigation/indices (rule index, language rules list, tools diagnostics TOC), and added both options to the example EditorConfig.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/navigate/tools-diagnostics/toc.yml | Adds IDE0221 to the tools diagnostics TOC for discoverability. |
| docs/fundamentals/code-analysis/style-rules/language-rules.md | Adds IDE0221 to the C# style rules list. |
| docs/fundamentals/code-analysis/style-rules/index.md | Links IDE0070 and IDE0221 to their documented options in the main rules index table. |
| docs/fundamentals/code-analysis/style-rules/ide0221.md | Introduces the full IDE0221 rule reference page, including option details and examples. |
| docs/fundamentals/code-analysis/style-rules/ide0070.md | Documents the dotnet_prefer_system_hash_code option for IDE0070. |
| docs/fundamentals/code-analysis/code-style-rule-options.md | Adds the two new options to the example EditorConfig snippet. |
BillWagner
approved these changes
Apr 13, 2026
Member
BillWagner
left a comment
There was a problem hiding this comment.
This LGTM. You can
when ready.
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.
Two EditorConfig style rules introduced in Visual Studio 2026 18.4.0 were undocumented. This PR adds the missing option to IDE0070 and creates the full reference page for IDE0221.
IDE0070 —
dotnet_prefer_system_hash_codeThe rule already existed but was documented as having no options. The option was added:
ide0070.md: addeddotnet_prefer_system_hash_codeto frontmatter keywords, properties table, and replaced the "no options" placeholder with a proper Options section (true|false, default:true)index.md: linked the option in the rule index tableIDE0221 —
dotnet_style_prefer_non_hidden_explicit_cast_in_sourceNew rule that flags explicit casts where the compiler silently inserts an additional hidden explicit cast. Both casts can fail at runtime independently, so the rule recommends making all intermediate casts visible.
ide0221.mdwith full rule reference (C#-only, optiontrue|false, default:true)index.mdtable,language-rules.mdC# expression-level preferences list, andtools-diagnostics/toc.ymlcode-style-rule-options.mdexample EditorConfigInternal previews