Skip to content

Commit

Permalink
[Update] handlebars helpers to use the discard parameter instead (_)
Browse files Browse the repository at this point in the history
  • Loading branch information
samatstariongroup committed Dec 29, 2024
1 parent 6fe828d commit c5c1063
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 39 deletions.
18 changes: 9 additions & 9 deletions uml4net.HandleBars/ClassHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class ClassHelper
/// </param>
public static void RegisterClassHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("Class.QueryAllProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -52,7 +52,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllContainedProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllContainedProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -66,7 +66,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllContainedNonDerivedProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllContainedNonDerivedProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -81,7 +81,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllContainedNonDerivedNonRedefinedProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllContainedNonDerivedNonRedefinedProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand Down Expand Up @@ -110,7 +110,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return nonRedefinedProperties;
});

handlebars.RegisterHelper("Class.QueryAllNonDerivedProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllNonDerivedProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -124,7 +124,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -138,7 +138,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -152,7 +152,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyNonContainedReferenceEnumerableProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyNonContainedReferenceEnumerableProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -171,7 +171,7 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
return properties;
});

handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyNonContainedNonRedefinedReferenceEnumerableProperties", (context, parameters) =>
handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyNonContainedNonRedefinedReferenceEnumerableProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand Down
14 changes: 7 additions & 7 deletions uml4net.HandleBars/DecoratorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static class DecoratorHelper
/// </param>
public static void RegisterDecoratorHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("Decorator.WriteClassAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WriteClassAttribute", (writer, context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -60,7 +60,7 @@ public static void RegisterDecoratorHelper(this IHandlebars handlebars)
writer.WriteSafeString(classAttribute);
});

handlebars.RegisterHelper("Decorator.WriteImplementsAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WriteImplementsAttribute", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand All @@ -76,7 +76,7 @@ public static void RegisterDecoratorHelper(this IHandlebars handlebars)
writer.WriteSafeString(implementsAttribute);
});

handlebars.RegisterHelper("Decorator.WritePropertyAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WritePropertyAttribute", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand Down Expand Up @@ -105,7 +105,7 @@ public static void RegisterDecoratorHelper(this IHandlebars handlebars)
writer.WriteSafeString($"{propertyAttribute}" + Environment.NewLine);
});

handlebars.RegisterHelper("Decorator.WriteRedefinedPropertyAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WriteRedefinedPropertyAttribute", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand All @@ -125,7 +125,7 @@ public static void RegisterDecoratorHelper(this IHandlebars handlebars)
}
});

handlebars.RegisterHelper("Decorator.WriteRedefinedByPropertyAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WriteRedefinedByPropertyAttribute", (writer, _, parameters) =>
{
if (parameters.Length != 2)
{
Expand All @@ -142,7 +142,7 @@ public static void RegisterDecoratorHelper(this IHandlebars handlebars)
}
});

handlebars.RegisterHelper("Decorator.WriteSubsettedPropertyAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WriteSubsettedPropertyAttribute", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand All @@ -162,7 +162,7 @@ public static void RegisterDecoratorHelper(this IHandlebars handlebars)
}
});

handlebars.RegisterHelper("Decorator.WriteImplementsAttribute", (writer, context, parameters) =>
handlebars.RegisterHelper("Decorator.WriteImplementsAttribute", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand Down
4 changes: 2 additions & 2 deletions uml4net.HandleBars/DocumentationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class DocumentationHelper
/// </param>
public static void RegisteredDocumentationHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("Documentation", (writer, context, parameters) =>
handlebars.RegisterHelper("Documentation", (writer, context, _) =>
{
if (!(context.Value is IElement eModelElement))
{
Expand All @@ -55,7 +55,7 @@ public static void RegisteredDocumentationHelper(this IHandlebars handlebars)
writer.WriteSafeString($"/// </summary>{Environment.NewLine}");
});

handlebars.RegisterHelper("RawDocumentation", (writer, context, parameters) =>
handlebars.RegisterHelper("RawDocumentation", (writer, context, _) =>
{
if (!(context.Value is IElement element))
{
Expand Down
2 changes: 1 addition & 1 deletion uml4net.HandleBars/EnumHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static string EnumToString<TEnum>(TEnum enumValue) where TEnum : Enum
/// </param>
public static void RegisterEnumHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("Enum.ToString", (writer, context, parameters) =>
handlebars.RegisterHelper("Enum.ToString", (writer, _, parameters) =>
{
if (parameters.Length != 1)
{
Expand Down
4 changes: 2 additions & 2 deletions uml4net.HandleBars/GeneralizationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class GeneralizationHelper
/// </param>
public static void RegisterGeneralizationHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("Generalization.Interfaces", (writer, context, parameters) =>
handlebars.RegisterHelper("Generalization.Interfaces", (writer, context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand All @@ -55,7 +55,7 @@ public static void RegisterGeneralizationHelper(this IHandlebars handlebars)
}
});

handlebars.RegisterHelper("Generalization.Classes", (writer, context, parameters) =>
handlebars.RegisterHelper("Generalization.Classes", (writer, context, _) =>
{
if (!(context.Value is IClass @class))
{
Expand Down
30 changes: 15 additions & 15 deletions uml4net.HandleBars/PropertyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
}
});

handlebars.RegisterHelper("Property.QueryStructuralFeatureNameEqualsEnclosingType", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryStructuralFeatureNameEqualsEnclosingType", (_, arguments) =>
{
if (arguments.Length != 2)
{
Expand Down Expand Up @@ -104,7 +104,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
}
});

handlebars.RegisterHelper("Property.QueryIsEnum", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsEnum", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -116,7 +116,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property.QueryIsEnum();
});

handlebars.RegisterHelper("Property.IsEnum", (context, arguments) =>
handlebars.RegisterHelper("Property.IsEnum", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -128,7 +128,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property.QueryIsEnum();
});

handlebars.RegisterHelper("Property.QueryIsBool", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsBool", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -140,7 +140,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property.QueryIsBool();
});

handlebars.RegisterHelper("Property.QueryIsNumeric", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsNumeric", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -152,7 +152,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property.QueryIsNumeric();
});

handlebars.RegisterHelper("Property.QueryIsInteger", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsInteger", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -164,7 +164,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property?.Type?.Name.ToLowerInvariant().Contains("int");
});

handlebars.RegisterHelper("Property.QueryIsFloat", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsFloat", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -175,7 +175,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return typeName is not null && (typeName.Contains("single") || typeName.Contains("float"));
});

handlebars.RegisterHelper("Property.QueryIsDouble", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsDouble", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -186,7 +186,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return typeName?.Contains("double");
});

handlebars.RegisterHelper("Property.QueryIsDateTime", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsDateTime", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -197,7 +197,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return typeName?.Contains("date");
});

handlebars.RegisterHelper("Property.QueryHasDefaultValue", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryHasDefaultValue", (_, arguments) =>
{
if (arguments.Length != 1)
{
Expand All @@ -209,7 +209,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property.QueryHasDefaultValue();
});

handlebars.RegisterHelper("Property.QueryIsContainment", (context, arguments) =>
handlebars.RegisterHelper("Property.QueryIsContainment", (context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand All @@ -219,7 +219,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
return property.QueryIsContainment();
});

handlebars.RegisterHelper("Property.WriteTypeName", (writer, context, parameters) =>
handlebars.RegisterHelper("Property.WriteTypeName", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand All @@ -231,7 +231,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
writer.WriteSafeString($"{typeName}");
});

handlebars.RegisterHelper("Property.WriteUpperValue", (writer, context, arguments) =>
handlebars.RegisterHelper("Property.WriteUpperValue", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand All @@ -243,7 +243,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
writer.WriteSafeString($"{upperValue}");
});

handlebars.RegisterHelper("Property.WriteForInterface", (writer, context, arguments) =>
handlebars.RegisterHelper("Property.WriteForInterface", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand Down Expand Up @@ -308,7 +308,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars)
writer.WriteSafeString(sb + Environment.NewLine);
});

handlebars.RegisterHelper("Property.WriteForClass", (writer, context, parameters) =>
handlebars.RegisterHelper("Property.WriteForClass", (writer, _, parameters) =>
{
if (parameters.Length != 2)
{
Expand Down
4 changes: 2 additions & 2 deletions uml4net.HandleBars/StringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class StringHelper
/// </param>
public static void RegisterStringHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("String.CapitalizeFirstLetter", (writer, context, parameters) =>
handlebars.RegisterHelper("String.CapitalizeFirstLetter", (writer, _, parameters) =>
{
if (parameters.Length != 1)
{
Expand All @@ -49,7 +49,7 @@ public static void RegisterStringHelper(this IHandlebars handlebars)
writer.WriteSafeString(value.CapitalizeFirstLetter());
});

handlebars.RegisterHelper("String.LowerCaseFirstLetter", (writer, context, parameters) =>
handlebars.RegisterHelper("String.LowerCaseFirstLetter", (writer, _, parameters) =>
{
if (parameters.Length != 1)
{
Expand Down
2 changes: 1 addition & 1 deletion uml4net.HandleBars/TypeNameHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static class TypeNameHelper
/// </param>
public static void RegisterTypeNameHelper(this IHandlebars handlebars)
{
handlebars.RegisterHelper("POCO.TypeName", (writer, context, parameters) =>
handlebars.RegisterHelper("POCO.TypeName", (writer, context, _) =>
{
if (!(context.Value is IProperty property))
{
Expand Down

0 comments on commit c5c1063

Please sign in to comment.