Skip to content

Enable IDE2000 #39803

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 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ file_header_template = Licensed to the .NET Foundation under one or more agreeme
# IDE0161: Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = warning

# IDE2000: Disallow multiple blank lines
dotnet_style_allow_multiple_blank_lines_experimental = false
dotnet_diagnostic.IDE2000.severity = warning

[**/{test,samples,perf}/**.{cs,vb}]
# CA1018: Mark attributes with AttributeUsageAttribute
dotnet_diagnostic.CA1018.severity = suggestion
Expand Down
2 changes: 0 additions & 2 deletions src/Analyzers/Analyzers/test/MinimalStartupTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,6 @@ protected Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expe
return test.RunAsync();
}



[Fact]
public async Task StartupAnalyzer_AuthNoRouting()
{
Expand Down
1 change: 0 additions & 1 deletion src/Analyzers/Analyzers/test/StartupFactsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ internal void Configure(IApplicationBuilder app)
[nameof(NotAStartupClass)] = NotAStartupClass,
};


[Theory]
[InlineData(nameof(BasicStartup), "ConfigureServices")]
[InlineData(nameof(EnvironmentStartup), "ConfigureDevelopmentServices")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public static IServiceCollection AddAntiforgery(this IServiceCollection services
services.TryAddSingleton<IAntiforgeryAdditionalDataProvider, DefaultAntiforgeryAdditionalDataProvider>();
services.TryAddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>();


services.TryAddSingleton<ObjectPool<AntiforgerySerializationContext>>(serviceProvider =>
{
var provider = serviceProvider.GetRequiredService<ObjectPoolProvider>();
Expand Down
2 changes: 0 additions & 2 deletions src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ public void IsCookieTokenValid_ValidToken_ReturnsTrue()
Assert.True(isValid);
}


[Fact]
public void TryValidateTokenSet_CookieTokenMissing()
{
Expand Down Expand Up @@ -296,7 +295,6 @@ public void TryValidateTokenSet_FieldTokenMissing()
claimUidExtractor: null,
additionalDataProvider: null);


// Act & Assert
string message;
var ex = Assert.Throws<ArgumentNullException>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class AzureADB2COptions
/// </summary>
public string JwtBearerSchemeName { get; internal set; }


/// <summary>
/// Gets or sets the client Id.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public static SqlParameterCollection AddExpiresAtTimeMono(
return parameters.AddWithValue(Columns.Names.ExpiresAtTime, SqlDbType.DateTime, utcTime.UtcDateTime);
}


public static SqlParameterCollection AddAbsoluteExpirationMono(
this SqlParameterCollection parameters,
DateTimeOffset? utcTime)
Expand Down
1 change: 0 additions & 1 deletion src/Components/Components/src/BindConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ private static string FormatDateTimeValueCore(DateTime value, CultureInfo? cultu
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Required to maintain compatibility")]
public static string FormatValue(DateTimeOffset value, CultureInfo? culture = null) => FormatDateTimeOffsetValueCore(value, format: null, culture);


/// <summary>
/// Formats the provided <paramref name="value"/> as a <see cref="System.String"/>.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion src/Components/Components/src/ComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ void IComponent.Attach(RenderHandle renderHandle)
_renderHandle = renderHandle;
}


/// <summary>
/// Sets parameters supplied by the component's parent in the render tree.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ public void AddAttribute(int sequence, string name)
throw new InvalidOperationException($"Valueless attributes may only be added immediately after frames of type {RenderTreeFrameType.Element}");
}


_entries.AppendAttribute(sequence, name, BoxedTrue);
}

Expand Down
21 changes: 0 additions & 21 deletions src/Components/Components/test/EventCallbackTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public async Task EventCallbackOfT_Default()
await callback.InvokeAsync();
}


[Fact]
public async Task EventCallback_NullReceiver()
{
Expand All @@ -38,7 +37,6 @@ public async Task EventCallback_NullReceiver()
// Act
await callback.InvokeAsync();


// Assert
Assert.Equal(1, runCount);
}
Expand All @@ -53,7 +51,6 @@ public async Task EventCallbackOfT_NullReceiver()
// Act
await callback.InvokeAsync();


// Assert
Assert.Equal(1, runCount);
}
Expand All @@ -70,7 +67,6 @@ public async Task EventCallback_Action_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -88,7 +84,6 @@ public async Task EventCallback_Action_IgnoresArg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -107,7 +102,6 @@ public async Task EventCallback_ActionT_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Null(arg);
Assert.Equal(1, runCount);
Expand All @@ -127,7 +121,6 @@ public async Task EventCallback_ActionT_Arg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.NotNull(arg);
Assert.Equal(1, runCount);
Expand All @@ -147,7 +140,6 @@ public async Task EventCallback_ActionT_Arg_ValueType()
// Act
await callback.InvokeAsync(17);


// Assert
Assert.Equal(17, arg);
Assert.Equal(1, runCount);
Expand Down Expand Up @@ -183,7 +175,6 @@ public async Task EventCallback_FuncTask_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -201,7 +192,6 @@ public async Task EventCallback_FuncTask_IgnoresArg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -220,7 +210,6 @@ public async Task EventCallback_FuncTTask_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Null(arg);
Assert.Equal(1, runCount);
Expand All @@ -240,7 +229,6 @@ public async Task EventCallback_FuncTTask_Arg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.NotNull(arg);
Assert.Equal(1, runCount);
Expand All @@ -260,7 +248,6 @@ public async Task EventCallback_FuncTTask_Arg_ValueType()
// Act
await callback.InvokeAsync(17);


// Assert
Assert.Equal(17, arg);
Assert.Equal(1, runCount);
Expand Down Expand Up @@ -296,7 +283,6 @@ public async Task EventCallbackOfT_Action_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -314,7 +300,6 @@ public async Task EventCallbackOfT_Action_IgnoresArg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -333,7 +318,6 @@ public async Task EventCallbackOfT_ActionT_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Null(arg);
Assert.Equal(1, runCount);
Expand All @@ -353,7 +337,6 @@ public async Task EventCallbackOfT_ActionT_Arg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.NotNull(arg);
Assert.Equal(1, runCount);
Expand All @@ -372,7 +355,6 @@ public async Task EventCallbackOfT_FuncTask_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -390,7 +372,6 @@ public async Task EventCallbackOfT_FuncTask_IgnoresArg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.Equal(1, runCount);
Assert.Equal(1, component.Count);
Expand All @@ -409,7 +390,6 @@ public async Task EventCallbackOfT_FuncTTask_Null()
// Act
await callback.InvokeAsync();


// Assert
Assert.Null(arg);
Assert.Equal(1, runCount);
Expand All @@ -429,7 +409,6 @@ public async Task EventCallbackOfT_FuncTTask_Arg()
// Act
await callback.InvokeAsync(new EventArgs());


// Assert
Assert.NotNull(arg);
Assert.Equal(1, runCount);
Expand Down
Loading