diff options
author | Pranav K <prkrishn@hotmail.com> | 2022-01-05 23:25:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 23:25:17 +0300 |
commit | 6aa132d64ae88c36ae3a7dfb92ad3994a162575a (patch) | |
tree | 37f5efcbef88655164aef17d0ac1f2f95cc41873 /.editorconfig | |
parent | e10e6bebf55449fdf51a1fb2b6f274695e88fd30 (diff) |
Enforce braces for code-blocks
Contributes to https://github.com/dotnet/aspnetcore/issues/24055 (#39320)
Diffstat (limited to '.editorconfig')
-rw-r--r-- | .editorconfig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig index 662cf391ad..3f8668ae71 100644 --- a/.editorconfig +++ b/.editorconfig @@ -52,6 +52,9 @@ csharp_new_line_before_members_in_anonymous_types = true # Namespace settings csharp_style_namespace_declarations = file_scoped +# Brace settings +csharp_prefer_braces = true # Prefer curly braces even for one line of code + [*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}] indent_size = 2 @@ -198,6 +201,9 @@ dotnet_diagnostic.CA2208.severity = warning # IDE0005: Remove unnecessary usings dotnet_diagnostic.IDE0005.severity = warning +# IDE0011: Curly braces to surround blocks of code +dotnet_diagnostic.IDE0011.severity = warning + # IDE0035: Remove unreachable code dotnet_diagnostic.IDE0035.severity = warning @@ -267,6 +273,8 @@ dotnet_diagnostic.CA2016.severity = suggestion # Defaults for content in the shared src/ and shared runtime dir [{**/Shared/runtime/**.{cs,vb},src/Shared/test/Shared.Tests/runtime/**.{cs,vb},**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}] +# IDE0011: Use braces +dotnet_diagnostic.IDE0011.severity = silent # IDE0055: Fix formatting dotnet_diagnostic.IDE0055.severity = silent # IDE0161: Convert to file-scoped namespace |