Skip to content

Commit c452bce

Browse files
committed
Shorten method signatures / resolve nuget security warnings during testing
1 parent 9e692d0 commit c452bce

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/DotLiquid.Tests/DotLiquid.Tests.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<PackageId>DotLiquid.Tests</PackageId>
1010
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
1111
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net451+win8;dnxcore5</PackageTargetFallback>
12-
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
13-
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">2.0.0</RuntimeFrameworkVersion>
12+
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.16</RuntimeFrameworkVersion>
13+
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">2.0.9</RuntimeFrameworkVersion>
1414
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
1515
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
1616
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
@@ -64,4 +64,8 @@
6464
<!-- This is simply to ensure formatting differences of .NET 5+ don't cause tests to fail -->
6565
<RuntimeHostConfigurationOption Include="System.Globalization.UseNls" Value="true" />
6666
</ItemGroup>
67+
68+
<ItemGroup>
69+
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-7mfr-774f-w5r9" /><!-- 'Microsoft.NETCore.App' 1.x Unpatched -->
70+
</ItemGroup>
6771
</Project>

src/DotLiquid/Util/StrFTime.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ public static class StrFTime
107107
/// <param name="culture">the CurrentCulture to be used when formatting</param>
108108
/// <returns>a string version of date-time matching pattern.</returns>
109109
public static string ToStrFTime(this DateOnly dateOnly, string format, CultureInfo culture)
110-
{
111-
return ObjectToStrFTime(dateOnly, format, culture);
112-
}
110+
=> ObjectToStrFTime(dateOnly, format, culture);
113111

114112
/// <summary>
115113
/// Applies formatting consistent to the rules specified by the Ruby Time.strftime function.
@@ -125,9 +123,7 @@ public static string ToStrFTime(this DateOnly dateOnly, string format, CultureIn
125123
/// <param name="culture">the CurrentCulture to be used when formatting</param>
126124
/// <returns>a string version of date-time matching pattern.</returns>
127125
public static string ToStrFTime(this TimeOnly timeOnly, string format, CultureInfo culture)
128-
{
129-
return ObjectToStrFTime(timeOnly, format, culture);
130-
}
126+
=> ObjectToStrFTime(timeOnly, format, culture);
131127
#endif
132128

133129
/// <summary>
@@ -144,9 +140,7 @@ public static string ToStrFTime(this TimeOnly timeOnly, string format, CultureIn
144140
/// <param name="culture">the CurrentCulture to be used when formatting</param>
145141
/// <returns>a string version of date-time matching pattern.</returns>
146142
public static string ToStrFTime(this DateTime dateTime, string format, CultureInfo culture)
147-
{
148-
return ObjectToStrFTime(dateTime, format, culture);
149-
}
143+
=> ObjectToStrFTime(dateTime, format, culture);
150144

151145
/// <summary>
152146
/// Formats a date using a ruby date format string
@@ -156,9 +150,7 @@ public static string ToStrFTime(this DateTime dateTime, string format, CultureIn
156150
/// <param name="culture">the CurrentCulture to be used when formatting</param>
157151
/// <returns>a string version of date-time matching pattern.</returns>
158152
public static string ToStrFTime(this DateTimeOffset dateTimeOffset, string format, CultureInfo culture)
159-
{
160-
return ObjectToStrFTime(dateTimeOffset, format, culture);
161-
}
153+
=> ObjectToStrFTime(dateTimeOffset, format, culture);
162154

163155
private static string ObjectToStrFTime(object source, string format, CultureInfo culture)
164156
{

0 commit comments

Comments
 (0)