Skip to content

Commit 1612edc

Browse files
authored
Refactor Namespace and Seald Classes in Microsoft.ML.AutoML.SourceGenerator Project (#7223)
* Make all classes in Microsoft.ML.AutoML.SourceGenerator project `sealed` * Refactor namespace from Microsoft.ML.ModelBuilder.SweepableEstimator.CodeGenerator to Microsoft.ML.AutoML.SourceGenerator
1 parent 70e5ab1 commit 1612edc

File tree

7 files changed

+8
-13
lines changed

7 files changed

+8
-13
lines changed

tools-local/Microsoft.ML.AutoML.SourceGenerator/Constant.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.ML.AutoML.SourceGenerator
66
{
7-
internal class Constant
7+
internal sealed class Constant
88
{
99
public const string CodeGeneratorNameSpace = "Microsoft.ML.AutoML.CodeGen";
1010
}

tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorContract.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Microsoft.ML.AutoML.SourceGenerator
1111
{
12-
internal class EstimatorContract
12+
internal sealed class EstimatorContract
1313
{
1414
[JsonPropertyName("functionName")]
1515
public string FunctionName { get; set; }

tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace Microsoft.ML.AutoML.SourceGenerator
1616
{
1717
[Generator]
18-
public class EstimatorTypeGenerator : ISourceGenerator
18+
public sealed class EstimatorTypeGenerator : ISourceGenerator
1919
{
2020
private const string className = "EstimatorType";
2121
private const string fullName = Constant.CodeGeneratorNameSpace + "." + className;

tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace Microsoft.ML.AutoML.SourceGenerator
1616
{
1717
[Generator]
18-
public class SearchSpaceGenerator : ISourceGenerator
18+
public sealed class SearchSpaceGenerator : ISourceGenerator
1919
{
2020
public void Execute(GeneratorExecutionContext context)
2121
{

tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace Microsoft.ML.AutoML.SourceGenerator
1414
{
1515
[Generator]
16-
public class SweepableEstimatorFactoryGenerator : ISourceGenerator
16+
public sealed class SweepableEstimatorFactoryGenerator : ISourceGenerator
1717
{
1818
private const string className = "SweepableEstimatorFactory";
1919

tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System;
65
using System.Collections.Generic;
7-
using System.Diagnostics;
86
using System.Linq;
97
using System.Text;
108
using System.Text.Json;
119
using Microsoft.CodeAnalysis;
12-
using Microsoft.CodeAnalysis.CSharp.Syntax;
1310
using Microsoft.CodeAnalysis.Text;
14-
using Microsoft.ML.AutoML.SourceGenerator;
15-
using SweepableEstimator = Microsoft.ML.AutoML.SourceGenerator.Template.SweepableEstimator;
1611
using SweepableEstimatorT = Microsoft.ML.AutoML.SourceGenerator.Template.SweepableEstimator_T_;
17-
namespace Microsoft.ML.ModelBuilder.SweepableEstimator.CodeGenerator
12+
namespace Microsoft.ML.AutoML.SourceGenerator
1813
{
1914
[Generator]
20-
public class SweepableEstimatorGenerator : ISourceGenerator
15+
public sealed class SweepableEstimatorGenerator : ISourceGenerator
2116
{
2217
private const string SweepableEstimatorAttributeDisplayName = Constant.CodeGeneratorNameSpace + "." + "SweepableEstimatorAttribute";
2318

tools-local/Microsoft.ML.AutoML.SourceGenerator/Utils.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.ML.AutoML.SourceGenerator
1212
{
13-
internal class Utils
13+
internal sealed class Utils
1414
{
1515
public static EstimatorsContract GetEstimatorsFromJson(string json)
1616
{

0 commit comments

Comments
 (0)