Skip to content

Document IDE2000-2006 newline preference rules #48011

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

Merged
merged 7 commits into from
Aug 20, 2025
Merged

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 19, 2025

This PR adds comprehensive documentation for IDE2000-2006, which are newline preference rules for .NET code analysis. These rules help enforce consistent formatting and readability standards for blank lines and statement placement in C# and Visual Basic code.

Changes Made

New Documentation Files

Created individual documentation files for each rule:

  • IDE2000: Avoid multiple blank lines
  • IDE2001: Embedded statements must be on their own line
  • IDE2002: Consecutive braces must not have blank line between them
  • IDE2003: Blank line required between block and subsequent statement
  • IDE2004: Blank line not allowed after constructor initializer colon
  • IDE2005: Blank line not allowed after conditional expression token
  • IDE2006: Blank line not allowed after arrow expression clause token

Each documentation file includes:

  • Proper YAML frontmatter with metadata
  • Rule property table with ID, title, category, and applicable languages
  • Overview explaining the rule's purpose
  • Code examples showing violations and correct formatting for both C# and Visual Basic (where applicable)
  • Standard suppression sections with EditorConfig configuration examples
  • Cross-references to related documentation

Updated Index Files

  • language-rules.md: Updated the "New-line preferences" section to link to the new documentation files instead of showing placeholder text
  • index.md: Added all seven rules to the alphabetical rule index table

Documentation Standards

All files follow established patterns from existing IDE rule documentation and include:

  • Microsoft Writing Style Guide compliance
  • AI usage disclosure in frontmatter
  • Consistent formatting and structure
  • Proper markdown syntax with balanced code fences
  • EditorConfig examples matching the established pattern with [*.{cs,vb}] section headers

The documentation addresses the gap identified in the Roslyn repository's RulesMissingDocumentation.md file and provides developers with clear guidance on these newline formatting rules.

Fixes #47510.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Internal previews

📄 File 🔗 Preview link
docs/fundamentals/code-analysis/style-rules/ide2000.md Avoid multiple blank lines (IDE2000)
docs/fundamentals/code-analysis/style-rules/ide2001.md Embedded statements must be on their own line (IDE2001)
docs/fundamentals/code-analysis/style-rules/ide2002.md "IDE2002: Consecutive braces must not have blank line between them"
docs/fundamentals/code-analysis/style-rules/ide2003.md Blank line required between block and subsequent statement (IDE2003)
docs/fundamentals/code-analysis/style-rules/ide2004.md docs/fundamentals/code-analysis/style-rules/ide2004
docs/fundamentals/code-analysis/style-rules/ide2005.md Blank line not allowed after conditional expression token (IDE2005)
docs/fundamentals/code-analysis/style-rules/ide2006.md "IDE2006: Blank line not allowed after arrow expression clause token"
docs/fundamentals/code-analysis/style-rules/index.md Code-style rules
docs/fundamentals/code-analysis/style-rules/language-rules.md Language and unnecessary rules
docs/navigate/tools-diagnostics/toc.yml docs/navigate/tools-diagnostics/toc

@Copilot Copilot AI changed the title [WIP] Document IDE2000-2006 Document IDE2000-2006 newline preference rules Aug 19, 2025
@Copilot Copilot AI requested a review from gewarren August 19, 2025 20:21
Copilot finished work on behalf of gewarren August 19, 2025 20:21
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Please address this feedback.

Copy link
Contributor Author

Copilot AI commented Aug 19, 2025

@copilot Please address this feedback.

Addressed all feedback items in commit 5c5c80f: updated dates to 08/19/2025, removed VB from dev_langs where no VB examples exist, added periods to all code comments, updated IDE2001 description, and simplified IDE2006 examples.

@Copilot Copilot AI requested a review from gewarren August 19, 2025 20:50
Copilot finished work on behalf of gewarren August 19, 2025 20:50
@gewarren gewarren marked this pull request as ready for review August 20, 2025 17:56
@gewarren gewarren requested a review from a team as a code owner August 20, 2025 17:56
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ready for final review.

@gewarren gewarren requested review from a team and CyrusNajmabadi August 20, 2025 18:02
@CyrusNajmabadi
Copy link
Member

FYI, these are all 'experimental'. So subject to change/removal at any time. Just want to make sure the docs reflect that. Users can use these. But we make no promises on them.

@gewarren gewarren enabled auto-merge (squash) August 20, 2025 21:05
@gewarren gewarren merged commit fc63e67 into main Aug 20, 2025
10 checks passed
@gewarren gewarren deleted the copilot/fix-47510 branch August 20, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document IDE2000-2006
3 participants