Skip to content

Commit ccd08e8

Browse files
authored
Fix spacing for generated classes (#1045)
1 parent 1d25019 commit ccd08e8

File tree

324 files changed

+2842
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+2842
-348
lines changed

CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public struct {_quantity.Name}
5757
public {_quantity.BaseType} Value => _value;
5858
5959
/// <inheritdoc />
60-
public {_unitEnumName} Unit => _unit;");
60+
public {_unitEnumName} Unit => _unit;
61+
");
6162

6263
// Constructor and static properties
6364
Writer.WL($@" /// <summary>
@@ -88,7 +89,8 @@ public struct {_quantity.Name}
8889
/// <summary>
8990
/// Represents the smallest possible value of Duration
9091
/// </summary>
91-
public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}({_quantity.BaseType}.MinValue, BaseUnit);");
92+
public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}({_quantity.BaseType}.MinValue, BaseUnit);
93+
");
9294

9395
// Decimal MaxValue = 79228162514264337593543950335M
9496
Writer.WLCondition(_quantity.BaseType == "decimal", $@"
@@ -97,7 +99,8 @@ public struct {_quantity.Name}
9799
/// <summary>
98100
/// Represents the smallest possible value of Duration
99101
/// </summary>
100-
public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}(-79228162514264337593543950335M, BaseUnit);");
102+
public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}(-79228162514264337593543950335M, BaseUnit);
103+
");
101104

102105
Writer.WL($@"
103106
/// <summary>
@@ -165,7 +168,6 @@ private void GenerateStaticFactoryMethods()
165168
");
166169
}
167170

168-
Writer.WL();
169171
Writer.WL($@"
170172
/// <summary>
171173
/// Dynamically convert from value and unit enum <see cref=""{_unitEnumName}"" /> to <see cref=""{_quantity.Name}"" />.
@@ -245,8 +247,7 @@ private void GenerateConversionMethods()
245247
};
246248
}
247249
248-
#endregion
249-
");
250+
#endregion");
250251
}
251252

252253
/// <inheritdoc cref="GetObsoleteAttributeOrNull(string)"/>

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ private void GenerateStaticConstructor()
166166
BaseUnit, Zero, BaseDimensions, QuantityType.{_quantity.Name});
167167
168168
DefaultConversionFunctions = new UnitConverter();
169-
170169
RegisterDefaultConversions(DefaultConversionFunctions);
171170
}}
172171
");
@@ -376,7 +375,7 @@ internal static void RegisterDefaultConversions(UnitConverter unitConverter)
376375
Writer.WL($@"
377376
unitConverter.SetConversionFunction<{_quantity.Name}>({_unitEnumName}.{_quantity.BaseUnit}, {_quantity.Name}Unit.{unit.SingularName}, quantity => new {_quantity.Name}({func}, {_quantity.Name}Unit.{unit.SingularName}));");
378377
}
379-
378+
Writer.WL();
380379
Writer.WL($@"
381380
382381
// Register in unit converter: BaseUnit <-> BaseUnit
@@ -463,10 +462,10 @@ private void GenerateStaticFactoryMethods()
463462
{{
464463
{_valueType} value = ({_valueType}) {valueParamName};
465464
return new {_quantity.Name}(value, {_unitEnumName}.{unit.SingularName});
466-
}}");
465+
}}
466+
");
467467
}
468468

469-
Writer.WL();
470469
Writer.WL($@"
471470
/// <summary>
472471
/// Dynamically convert from value and unit enum <see cref=""{_unitEnumName}"" /> to <see cref=""{_quantity.Name}"" />.

CodeGen/Generators/UnitsNetWrcGen/QuantityGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,10 @@ private void GenerateStaticFactoryMethods()
352352
{{
353353
{_valueType} value = ({_valueType}) {valueParamName};
354354
return new {_quantity.Name}(value, {_unitEnumName}.{unit.SingularName});
355-
}}");
355+
}}
356+
");
356357
}
357358

358-
Writer.WL();
359359
Writer.WL($@"
360360
/// <summary>
361361
/// Dynamically convert from value and unit enum <see cref=""{_unitEnumName}"" /> to <see cref=""{_quantity.Name}"" />.

UnitsNet.NanoFramework/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/Angle.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/ApparentEnergy.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/ApparentPower.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/Area.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaDensity.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)