Skip to content

Commit ef12e13

Browse files
authored
Enable MSML_SingleVariableDeclaration for the full solution (dotnet#4765)
1 parent 4c1ddd6 commit ef12e13

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ dotnet_diagnostic.MSML_GeneralName.severity = none
1818
# MSML_PrivateFieldName: Private field name not in: _camelCase format
1919
dotnet_diagnostic.MSML_PrivateFieldName.severity = none
2020

21-
# MSML_SingleVariableDeclaration: Have only a single variable present per declaration
22-
dotnet_diagnostic.MSML_SingleVariableDeclaration.severity = none
23-
2421
# MSML_NoBestFriendInternal: Cross-assembly internal access requires referenced item to have Microsoft.ML.BestFriendAttribute attribute.
2522
dotnet_diagnostic.MSML_NoBestFriendInternal.severity = none
2623

test/Microsoft.ML.Core.Tests/UnitTests/ColumnTypes.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public void TestEqualAndGetHashCode()
1515
{
1616
var dict = new Dictionary<DataViewType, string>();
1717
// add PrimitiveTypes, KeyType & corresponding VectorTypes
18-
VectorDataViewType tmp1, tmp2;
18+
VectorDataViewType tmp1;
19+
VectorDataViewType tmp2;
1920
var types = new PrimitiveDataViewType[] { NumberDataViewType.SByte, NumberDataViewType.Int16, NumberDataViewType.Int32, NumberDataViewType.Int64,
2021
NumberDataViewType.Byte, NumberDataViewType.UInt16, NumberDataViewType.UInt32, NumberDataViewType.UInt64, RowIdDataViewType.Instance,
2122
TextDataViewType.Instance, BooleanDataViewType.Instance, DateTimeDataViewType.Instance, DateTimeOffsetDataViewType.Instance, TimeSpanDataViewType.Instance };

test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ public abstract class PerformanceTests
2727
internal AlignedArray testSrcVectorAligned;
2828
internal AlignedArray testDstVectorAligned;
2929

30-
protected float[] src, dst, original, src1, src2, result;
30+
protected float[] src;
31+
protected float[] dst;
32+
protected float[] original;
33+
protected float[] src1;
34+
protected float[] src2;
35+
protected float[] result;
3136
protected int[] idx;
3237
protected int[] matrixIdx;
3338

test/Microsoft.ML.TestFrameworkCommon/TestCommon.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ public static bool CheckSameSchemas(DataViewSchema sch1, DataViewSchema sch2, bo
9090
Assert.True(EqualTypes(type1, type2, exactTypes), $"column type mismatch at index {col}");
9191

9292
// This ensures that the two schemas map names to the same column indices.
93-
int col1, col2;
93+
int col1;
94+
int col2;
9495
bool f1 = sch1.TryGetColumnIndex(name1, out col1);
9596
bool f2 = sch2.TryGetColumnIndex(name2, out col2);
9697

@@ -152,7 +153,8 @@ public static bool CompareVec<T>(in VBuffer<T> v1, in VBuffer<T> v2, int size, F
152153
{
153154
int iv1 = v1.IsDense ? iiv1 : iiv1 < v1Indices.Length ? v1Indices[iiv1] : v1.Length;
154155
int iv2 = v2.IsDense ? iiv2 : iiv2 < v2Indices.Length ? v2Indices[iiv2] : v2.Length;
155-
T x1, x2;
156+
T x1;
157+
T x2;
156158
int iv;
157159
if (iv1 == iv2)
158160
{

test/Microsoft.ML.Tests/CalibratedModelParametersTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ private IDataView GetDenseDataset()
9797
// Setup synthetic dataset.
9898
const int numberOfInstances = 1000;
9999
var rand = new Random(10);
100-
float[] yArray = new float[numberOfInstances],
101-
x1Array = new float[numberOfInstances],
102-
x2Array = new float[numberOfInstances],
103-
x3Array = new float[numberOfInstances],
104-
x4RandArray = new float[numberOfInstances];
100+
float[] yArray = new float[numberOfInstances];
101+
float[] x1Array = new float[numberOfInstances];
102+
float[] x2Array = new float[numberOfInstances];
103+
float[] x3Array = new float[numberOfInstances];
104+
float[] x4RandArray = new float[numberOfInstances];
105105

106106
for (var i = 0; i < numberOfInstances; i++)
107107
{

test/Microsoft.ML.Tests/FeatureContributionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ private IDataView GetSparseDataset(TaskType task = TaskType.Regression, int numb
253253
{
254254
// Setup synthetic dataset.
255255
var rand = new Random(10);
256-
float[] yArray = new float[numberOfInstances],
257-
x1Array = new float[numberOfInstances],
258-
x3Array = new float[numberOfInstances];
256+
float[] yArray = new float[numberOfInstances];
257+
float[] x1Array = new float[numberOfInstances];
258+
float[] x3Array = new float[numberOfInstances];
259259

260260
VBuffer<float>[] vbArray = new VBuffer<float>[numberOfInstances];
261261

test/Microsoft.ML.Tests/PermutationFeatureImportanceTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,11 @@ private IDataView GetDenseDataset(TaskType task = TaskType.Regression)
559559
// Setup synthetic dataset.
560560
const int numberOfInstances = 1000;
561561
var rand = new Random(10);
562-
float[] yArray = new float[numberOfInstances],
563-
x1Array = new float[numberOfInstances],
564-
x2Array = new float[numberOfInstances],
565-
x3Array = new float[numberOfInstances],
566-
x4RandArray = new float[numberOfInstances];
562+
float[] yArray = new float[numberOfInstances];
563+
float[] x1Array = new float[numberOfInstances];
564+
float[] x2Array = new float[numberOfInstances];
565+
float[] x3Array = new float[numberOfInstances];
566+
float[] x4RandArray = new float[numberOfInstances];
567567

568568
for (var i = 0; i < numberOfInstances; i++)
569569
{
@@ -626,9 +626,9 @@ private IDataView GetSparseDataset(TaskType task = TaskType.Regression)
626626
// Setup synthetic dataset.
627627
const int numberOfInstances = 10000;
628628
var rand = new Random(10);
629-
float[] yArray = new float[numberOfInstances],
630-
x1Array = new float[numberOfInstances],
631-
x3Array = new float[numberOfInstances];
629+
float[] yArray = new float[numberOfInstances];
630+
float[] x1Array = new float[numberOfInstances];
631+
float[] x3Array = new float[numberOfInstances];
632632

633633
VBuffer<float>[] vbArray = new VBuffer<float>[numberOfInstances];
634634

0 commit comments

Comments
 (0)