-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Enable a few whitespace enforcing IDE rules #40769
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,11 @@ csharp_style_namespace_declarations = file_scoped | |
# Brace settings | ||
csharp_prefer_braces = true # Prefer curly braces even for one line of code | ||
|
||
# Whitespace options | ||
csharp_style_allow_embedded_statements_on_same_line_experimental = false | ||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false | ||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false | ||
Comment on lines
+58
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general, we should wait until experimental features have been released for real before incorporating them in this repo. There's no reason to rush here. |
||
|
||
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}] | ||
indent_size = 2 | ||
|
||
|
@@ -263,6 +268,18 @@ dotnet_diagnostic.IDE0161.severity = warning | |
dotnet_style_allow_multiple_blank_lines_experimental = false | ||
dotnet_diagnostic.IDE2000.severity = warning | ||
|
||
# IDE2001: Embedded statements must be on their own line | ||
dotnet_diagnostic.IDE2001.severity = warning | ||
|
||
# IDE2002: Consecutive braces must not have blank line between them | ||
dotnet_diagnostic.IDE2002.severity = warning | ||
|
||
# IDE2003: Blank line required between block and subsequent statement | ||
dotnet_diagnostic.IDE2003.severity = warning | ||
|
||
# IDE2004: Blank line not allowed after constructor initializer colon | ||
dotnet_diagnostic.IDE2004.severity = warning | ||
|
||
[{eng/tools/**.cs,**/{test,testassets,samples,Samples,perf}/**.cs}] | ||
# CA1018: Mark attributes with AttributeUsageAttribute | ||
dotnet_diagnostic.CA1018.severity = suggestion | ||
|
@@ -320,6 +337,8 @@ dotnet_diagnostic.IDE0059.severity = suggestion | |
dotnet_diagnostic.IDE0060.severity = suggestion | ||
# IDE0062: Make local function static | ||
dotnet_diagnostic.IDE0062.severity = suggestion | ||
# IDE2001: Embedded statements must be on their own line | ||
dotnet_diagnostic.IDE2001.severity = suggestion | ||
|
||
# CA2016: Forward the 'CancellationToken' parameter to methods that take one | ||
dotnet_diagnostic.CA2016.severity = suggestion | ||
|
@@ -339,6 +358,8 @@ dotnet_diagnostic.IDE0060.severity = silent | |
dotnet_diagnostic.IDE0062.severity = silent | ||
# IDE0161: Convert to file-scoped namespace | ||
dotnet_diagnostic.IDE0161.severity = silent | ||
# IDE2001: Embedded statements must be on their own line | ||
dotnet_diagnostic.IDE2001.severity = silent | ||
|
||
[{**/Shared/**.cs,**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}] | ||
# IDE0005: Remove unused usings. Ignore for shared src files since imports for those depend on the projects in which they are included. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,5 +51,4 @@ internal static async Task TransmitStreamAsync(IJSRuntime runtime, long streamId | |
} | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,6 @@ public string? this[string key] | |
{ | ||
provider.Set(key, value); | ||
} | ||
|
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,5 @@ public async Task XmlRoundTripsToActualRedisServer() | |
await redis.GetDatabase().KeyDeleteAsync(key); | ||
} | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,4 @@ public IEnumerable<TestEntry> GetFiles() | |
|
||
return files.Concat(otherFiles).ToArray(); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -413,5 +413,4 @@ public Task SignOutAsync(AuthenticationProperties? properties) | |
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,5 +190,4 @@ public Task SignOutAsync(AuthenticationProperties properties) | |
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
} |
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.
I don't know if @dotnet/aspdoi has discussed these settings but this particular one is actively annoying and I'd much rather we didn't take it.