From 93141216d60beaf2517ed718eb0a71ec6e5b3cf5 Mon Sep 17 00:00:00 2001 From: Jan Krivanek Date: Tue, 20 Feb 2024 14:59:31 +0100 Subject: [PATCH] Removing unnecessary types --- src/Analyzers/API/BuildAnalyzerConfiguration.cs | 4 ---- src/Analyzers/API/InvocationConcurrency.cs | 10 ---------- src/Analyzers/API/PerformanceWeightClass.cs | 11 ----------- .../BuildAnalyzerConfigurationInternal.cs | 2 -- .../Infrastructure/ConfigurationProvider.cs | 2 -- src/Analyzers/OM/ParsedItemsContext.cs | 13 ------------- 6 files changed, 42 deletions(-) delete mode 100644 src/Analyzers/API/InvocationConcurrency.cs delete mode 100644 src/Analyzers/API/PerformanceWeightClass.cs diff --git a/src/Analyzers/API/BuildAnalyzerConfiguration.cs b/src/Analyzers/API/BuildAnalyzerConfiguration.cs index 7a5b75a506c..77e2feca512 100644 --- a/src/Analyzers/API/BuildAnalyzerConfiguration.cs +++ b/src/Analyzers/API/BuildAnalyzerConfiguration.cs @@ -8,8 +8,6 @@ public class BuildAnalyzerConfiguration public static BuildAnalyzerConfiguration Default { get; } = new() { LifeTimeScope = Experimental.LifeTimeScope.PerProject, - SupportedInvocationConcurrency = InvocationConcurrency.Parallel, - PerformanceWeightClass = Experimental.PerformanceWeightClass.Normal, EvaluationAnalysisScope = Experimental.EvaluationAnalysisScope.AnalyzedProjectOnly, Severity = BuildAnalyzerResultSeverity.Info, IsEnabled = false, @@ -18,8 +16,6 @@ public class BuildAnalyzerConfiguration public static BuildAnalyzerConfiguration Null { get; } = new(); public LifeTimeScope? LifeTimeScope { get; internal init; } - public InvocationConcurrency? SupportedInvocationConcurrency { get; internal init; } - public PerformanceWeightClass? PerformanceWeightClass { get; internal init; } public EvaluationAnalysisScope? EvaluationAnalysisScope { get; internal init; } public BuildAnalyzerResultSeverity? Severity { get; internal init; } public bool? IsEnabled { get; internal init; } diff --git a/src/Analyzers/API/InvocationConcurrency.cs b/src/Analyzers/API/InvocationConcurrency.cs deleted file mode 100644 index f4e8bc61ad6..00000000000 --- a/src/Analyzers/API/InvocationConcurrency.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Microsoft.Build.Experimental; - -public enum InvocationConcurrency -{ - Sequential, - Parallel, -} diff --git a/src/Analyzers/API/PerformanceWeightClass.cs b/src/Analyzers/API/PerformanceWeightClass.cs deleted file mode 100644 index ea2d5aa2469..00000000000 --- a/src/Analyzers/API/PerformanceWeightClass.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Microsoft.Build.Experimental; - -public enum PerformanceWeightClass -{ - Lightweight, - Normal, - Heavyweight, -} diff --git a/src/Analyzers/Infrastructure/BuildAnalyzerConfigurationInternal.cs b/src/Analyzers/Infrastructure/BuildAnalyzerConfigurationInternal.cs index fdffcb98a27..0195b2273e0 100644 --- a/src/Analyzers/Infrastructure/BuildAnalyzerConfigurationInternal.cs +++ b/src/Analyzers/Infrastructure/BuildAnalyzerConfigurationInternal.cs @@ -16,8 +16,6 @@ namespace Microsoft.Build.Analyzers.Infrastructure; internal sealed class BuildAnalyzerConfigurationInternal { public LifeTimeScope LifeTimeScope { get; internal init; } - public InvocationConcurrency SupportedInvocationConcurrency { get; internal init; } - public PerformanceWeightClass PerformanceWeightClass { get; internal init; } public EvaluationAnalysisScope EvaluationAnalysisScope { get; internal init; } public BuildAnalyzerResultSeverity Severity { get; internal init; } public bool IsEnabled { get; internal init; } diff --git a/src/Analyzers/Infrastructure/ConfigurationProvider.cs b/src/Analyzers/Infrastructure/ConfigurationProvider.cs index 11abc7a75a1..0ba5c1d2381 100644 --- a/src/Analyzers/Infrastructure/ConfigurationProvider.cs +++ b/src/Analyzers/Infrastructure/ConfigurationProvider.cs @@ -85,11 +85,9 @@ public static BuildAnalyzerConfigurationInternal GetMergedConfiguration(BuildAna return new BuildAnalyzerConfigurationInternal() { - SupportedInvocationConcurrency = GetConfigValue(editorConfig, defaultConfig, cfg => cfg.SupportedInvocationConcurrency), EvaluationAnalysisScope = GetConfigValue(editorConfig, defaultConfig, cfg => cfg.EvaluationAnalysisScope), IsEnabled = GetConfigValue(editorConfig, defaultConfig, cfg => cfg.IsEnabled), LifeTimeScope = GetConfigValue(editorConfig, defaultConfig, cfg => cfg.LifeTimeScope), - PerformanceWeightClass = GetConfigValue(editorConfig, defaultConfig, cfg => cfg.PerformanceWeightClass), Severity = GetConfigValue(editorConfig, defaultConfig, cfg => cfg.Severity) }; diff --git a/src/Analyzers/OM/ParsedItemsContext.cs b/src/Analyzers/OM/ParsedItemsContext.cs index 5a29a628627..f9a4038599d 100644 --- a/src/Analyzers/OM/ParsedItemsContext.cs +++ b/src/Analyzers/OM/ParsedItemsContext.cs @@ -10,19 +10,9 @@ using Microsoft.Build.Construction; namespace Microsoft.Build.Experimental; -public enum ItemType -{ - ProjectReference, - PackageReference, - Compile, - EmbeddedResource -} public static class ItemTypeExtensions { - public static IEnumerable GetItemsOfType(this IEnumerable items, ItemType itemType) - => GetItemsOfType(items, itemType.ToString()); - public static IEnumerable GetItemsOfType(this IEnumerable items, string itemType) { @@ -36,9 +26,6 @@ public class ItemsHolder(IEnumerable items, IEnumerable Items { get; } = items; public IEnumerable ItemGroups { get; } = itemGroups; - public IEnumerable GetItemsOfType(ItemType itemType) - => Items.GetItemsOfType(itemType); - public IEnumerable GetItemsOfType(string itemType) { return Items.GetItemsOfType(itemType);