Skip to content

style: enforce braces on all control flow blocks#263

Merged
pm7y merged 1 commit intomasterfrom
style/enforce-braces
Feb 18, 2026
Merged

style: enforce braces on all control flow blocks#263
pm7y merged 1 commit intomasterfrom
style/enforce-braces

Conversation

@pm7y
Copy link
Owner

@pm7y pm7y commented Feb 18, 2026

Summary

  • Add csharp_prefer_braces = true : error to src/.editorconfig — the root = true directive was blocking inheritance of this rule from the repo-root config
  • Run dotnet format style --diagnostics IDE0011 to auto-fix all braceless if/else/for/foreach/while blocks across 52 files
  • Run CSharpier to ensure consistent formatting after brace additions

Test plan

  • Solution builds with 0 warnings and 0 errors
  • All 744 unit tests pass

🤖 Generated with Claude Code

Add csharp_prefer_braces rule to src/.editorconfig since root=true was
blocking inheritance from the repo-root config. Run dotnet format to
auto-fix all 52 files with braceless if/else/for/foreach/while blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 18, 2026 10:51
Copy link

Copilot AI left a 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 enforces consistent use of braces on all C# control flow blocks across the codebase by adding the csharp_prefer_braces = true : error rule to src/.editorconfig and auto-fixing all violations using dotnet format style --diagnostics IDE0011.

Changes:

  • Added csharp_prefer_braces = true : error to src/.editorconfig to enforce braces on all control flow statements
  • Applied auto-formatting to add braces to 52 files across the entire solution
  • Ran CSharpier to ensure consistent formatting after brace additions

Reviewed changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/.editorconfig Added csharp_prefer_braces rule to overcome root=true blocking inheritance
src/AzureEventGridSimulator/Program.cs Added braces to if statements and foreach loops
src/AzureEventGridSimulator/Infrastructure/ValidationIpAddressProvider.cs Added braces to if statement in lock block
src/AzureEventGridSimulator/Infrastructure/Settings/Subscribers/*.cs Added braces to validation if statements across all subscriber settings
src/AzureEventGridSimulator/Infrastructure/Settings/*.cs Added braces to if/foreach statements in settings classes
src/AzureEventGridSimulator/Infrastructure/Middleware/SasKeyValidator.cs Added braces to if statements in validation logic
src/AzureEventGridSimulator/Infrastructure/Mediator/ServiceCollectionExtensions.cs Added braces to foreach loop
src/AzureEventGridSimulator/Infrastructure/Extensions/*.cs Added braces to if/foreach statements in extension methods
src/AzureEventGridSimulator/Infrastructure/Dashboard/DashboardEndpoints.cs Added braces to if statement
src/AzureEventGridSimulator/Domain/Services/Validation/ContentTypeValidator.cs Added braces to if statements in content type validation
src/AzureEventGridSimulator/Domain/Services/Routing/RequestRouter.cs Added braces to if statements in request routing
src/AzureEventGridSimulator/Domain/Services/Retry/*.cs Added braces to if/while statements in retry logic
src/AzureEventGridSimulator/Domain/Services/*.cs Added braces to if/foreach statements in schema parsers and detectors
src/AzureEventGridSimulator/Domain/Services/Delivery/*.cs Added braces to if/foreach statements in delivery services
src/AzureEventGridSimulator/Domain/Services/Dashboard/EventHistoryStore.cs Added braces to while/if statements
src/AzureEventGridSimulator/Domain/Entities/*.cs Added braces to validation if statements
src/AzureEventGridSimulator/Domain/Commands/*.cs Added braces to foreach loops in command handlers
src/AzureEventGridSimulator/Controllers/*.cs Added braces to if statements in controllers
src/AzureEventGridSimulator.Tests/**/*.cs Added braces to if/for/foreach statements across all test files
src/AzureEventGridSimulator.ServiceDefaults/Extensions.cs Added braces to if statement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pm7y pm7y merged commit 98fdce6 into master Feb 18, 2026
16 checks passed
@pm7y pm7y deleted the style/enforce-braces branch February 18, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments