Skip to content

Commit

Permalink
missing var usage (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 15, 2024
1 parent 45df4ba commit bee89a7
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Humanizer/FluentDate/In.Months.tt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Humanizer;
public partial class In
{
<#var now = DateTime.Now;
for (int i = 0; i < 12; i++){
for (var i = 0; i < 12; i++){
var monthName = new DateTime(now.Year, i + 1, 1).ToString("MMMM");
#>
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/FluentDate/In.SomeTimeFrom.tt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Humanizer;
/// </summary>
public partial class In
{
<#for (int i = 1; i <= 10; i++){
<#for (var i = 1; i <= 10; i++){
var plural = ( i > 1 ? "s" : "");
var second = "Second" + plural;
var minute = "Minute" + plural;
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/FluentDate/InDate.Months.tt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Humanizer;
public partial class InDate
{
<#var now = DateTime.Now;
for (int i = 0; i < 12; i++){
for (var i = 0; i < 12; i++){
var monthName = new DateTime(now.Year, i + 1, 1).ToString("MMMM");
#>
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/FluentDate/InDate.SomeTimeFrom.tt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Humanizer;
/// </summary>
public partial class InDate
{
<#for (int i = 1; i <= 10; i++){
<#for (var i = 1; i <= 10; i++){
var plural = ( i > 1 ? "s" : "");

var day = "Day" + plural;
Expand Down
4 changes: 2 additions & 2 deletions src/Humanizer/FluentDate/On.Days.tt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class On
{
<#
const int leapYear = 2012;
for (int month = 1; month <= 12; month++)
for (var month = 1; month <= 12; month++)
{
var firstDayOfMonth = new DateTime(leapYear, month, 1);
var monthName = firstDayOfMonth.ToString("MMMM");#>
Expand All @@ -28,7 +28,7 @@ for (int month = 1; month <= 12; month++)
public static DateTime The(int dayNumber)
=> new(DateTime.Now.Year, <#= month #>, dayNumber);

<#for (int day = 1; day <= DateTime.DaysInMonth(leapYear, month); day++)
<#for (var day = 1; day <= DateTime.DaysInMonth(leapYear, month); day++)
{
var ordinalDay = day.Ordinalize();#>

Expand Down
4 changes: 2 additions & 2 deletions src/Humanizer/FluentDate/OnDate.Days.tt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class OnDate
{
<#
const int leapYear = 2012;
for (int month = 1; month <= 12; month++)
for (var month = 1; month <= 12; month++)
{
var firstDayOfMonth = new DateTime(leapYear, month, 1);
var monthName = firstDayOfMonth.ToString("MMMM");#>
Expand All @@ -28,7 +28,7 @@ for (int month = 1; month <= 12; month++)
/// </summary>
public static DateOnly The(int dayNumber)
=> new(DateTime.Now.Year, <#= month #>, dayNumber);
<#for (int day = 1; day <= DateTime.DaysInMonth(leapYear, month); day++)
<#for (var day = 1; day <= DateTime.DaysInMonth(leapYear, month); day++)
{
var ordinalDay = day.Ordinalize();#>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private string Convert(long input, GrammaticalGender gender, bool isOrdinal, boo
input = -input;
}

string lastOrdinalSubstitution = "";
var lastOrdinalSubstitution = "";

if ((input / 1000000000000) > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class MalteseNumberToWordsConvertor : GenderedNumberToWordsConverter

public override string Convert(long input, GrammaticalGender gender, bool addAnd = true)
{
bool negativeNumber = false;
var negativeNumber = false;

if (input < 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ private static string GetThousandsValue(ref long number)
}
private static string GetHundredsValue(ref long number)
{
string local_word = "";

var local_word = "";
{
local_word = HundredsMap[(number / 100) - 1];
if (number / 100 == 9)
Expand Down

0 comments on commit bee89a7

Please sign in to comment.