Skip to content

Commit 010ffe6

Browse files
committed
Consolidate general-purpose analyzers
We have some non-MVC analyzers hanging out in the Mvc.Analyzers package. Part of: #12288
1 parent b841326 commit 010ffe6

35 files changed

+61
-144
lines changed

src/Analyzers/Analyzers/src/Microsoft.AspNetCore.Analyzers.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<IncludeBuildOutput>false</IncludeBuildOutput>
1616
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1717
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
18+
<Nullable>Enable</Nullable>
1819
</PropertyGroup>
1920

2021
<ItemGroup>

src/Mvc/Mvc.Analyzers/src/Startup/OptionsFacts.cs renamed to src/Analyzers/Analyzers/src/OptionsFacts.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using Microsoft.AspNetCore.Mvc.Analyzers;
65
using Microsoft.CodeAnalysis;
76

87
namespace Microsoft.AspNetCore.Analyzers
@@ -14,8 +13,8 @@ public static bool IsEndpointRoutingExplicitlyDisabled(OptionsAnalysis analysis)
1413
for (var i = 0; i < analysis.Options.Length; i++)
1514
{
1615
var item = analysis.Options[i];
17-
if (string.Equals(item.OptionsType.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat), SymbolNames.MvcOptions) &&
18-
string.Equals(item.Property.Name, SymbolNames.EnableEndpointRoutingProperty, StringComparison.Ordinal))
16+
if (string.Equals(item.OptionsType.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat), SymbolNames.MvcOptions.MetadataName) &&
17+
string.Equals(item.Property.Name, SymbolNames.MvcOptions.EnableEndpointRoutingPropertyName, StringComparison.Ordinal))
1918
{
2019
return item.ConstantValue as bool? == false;
2120
}

0 commit comments

Comments
 (0)