Skip to content

Commit

Permalink
Merge pull request #2067 from andy840119/apply-trailing-comma
Browse files Browse the repository at this point in the history
Normalise trailing commas in code.
  • Loading branch information
andy840119 authored Jul 15, 2023
2 parents 64858f5 + 67dd370 commit 7f7ed72
Show file tree
Hide file tree
Showing 493 changed files with 1,607 additions and 1,602 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ c3d76bde9f3d78b420ab6a18b8191c00a503b2be
3546a366f24d23dee1188758df0f8c6744dd1001
# Make main project to the file-scope namespace
5597711949c30a9699c4ab3957c0d98e6ff2212c
# Apply the trailing comma in the whole solution.
70fa847a40aa6a6c8ea3f1b277e4c2a23c8484a4
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void TestSliceNoteTime(double startPercentage, double durationPercentage,
{
ReferenceLyricId = referencedLyric.ID,
ReferenceLyric = referencedLyric,
ReferenceTimeTagIndex = 0
ReferenceTimeTagIndex = 0,
};

if (expected != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,32 @@ public void TestEncodeBeatmapLyric()
{
StartIndex = 0,
EndIndex = 0,
Text = "か"
Text = "か",
},
new RubyTag
{
StartIndex = 2,
EndIndex = 2,
Text = "お"
}
Text = "お",
},
},
RomajiTags = new[]
{
new RomajiTag
{
StartIndex = 1,
EndIndex = 1,
Text = "ra"
Text = "ra",
},
new RomajiTag
{
StartIndex = 3,
EndIndex = 3,
Text = "ke"
}
Text = "ke",
},
},
}
}
},
},
};

using var ms = new MemoryStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void TestEncodeBeatmapToPureText(string[] lyrics, string expected)
var encoder = new LyricTextEncoder();
var beatmap = new KaraokeBeatmap
{
HitObjects = TestCaseTagHelper.ParseLyrics(lyrics).OfType<KaraokeHitObject>().ToList()
HitObjects = TestCaseTagHelper.ParseLyrics(lyrics).OfType<KaraokeHitObject>().ToList(),
};

string actual = encoder.Encode(beatmap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObj
{
StartTime = obj.StartTime,
EndTime = obj.EndTime,
Lyric = obj.Text
Lyric = obj.Text,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private IBeatmap createBeatmap()
createLyric(lyric_2_id, 2100, 3000),
createLyric(lyric_3_id, 3100, 4000),
createLyric(lyric_4_id, 4100, 5000),
createLyric(lyric_5_id, 5100, 6000)
createLyric(lyric_5_id, 5100, 6000),
};

lyrics.Reverse();
Expand All @@ -119,7 +119,7 @@ private static Lyric createLyric(int id, double startTime, double endTime)
TimeTags = new List<TimeTag>
{
new(new TextIndex(), startTime),
new(new TextIndex(), endTime)
new(new TextIndex(), endTime),
},
}.ChangeId(id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected override void LoadComplete()
{
Size = new Vector2(0.5f, 245),
RelativeSizeAxes = Axes.X,
Margin = new MarginPadding { Top = 20 }
Margin = new MarginPadding { Top = 20 },
});

AddStep("show", () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void load()
Children = new Drawable[]
{
editorBeatmap,
changeHandler = CreateChangeHandler()
changeHandler = CreateChangeHandler(),
};
}

Expand Down Expand Up @@ -240,7 +240,7 @@ protected void AssertWorkingPropertyInHitObjectValid()
{
Lyric lyric => lyric.GetAllInvalidWorkingProperties().Length == 0,
Note note => note.GetAllInvalidWorkingProperties().Length == 0,
_ => throw new NotSupportedException()
_ => throw new NotSupportedException(),
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ protected override void SetUpKaraokeBeatmap(Action<KaraokeBeatmap> action)
var stageInfo = new ClassicStageInfo();
karaokeBeatmap.StageInfos = new List<StageInfo>
{
stageInfo
stageInfo,
};
karaokeBeatmap.CurrentStageInfo = stageInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void TestAdd()
{
karaokeBeatmap.AvailableTranslates = new List<CultureInfo>
{
new("zh-TW")
new("zh-TW"),
};
});

Expand All @@ -45,7 +45,7 @@ public void TestRemove()
karaokeBeatmap.AvailableTranslates = new List<CultureInfo>
{
new("zh-TW"),
new("Ja-jp")
new("Ja-jp"),
};
});

Expand All @@ -69,7 +69,7 @@ public void TestIsLanguageContainsTranslate()
karaokeBeatmap.AvailableTranslates = new List<CultureInfo>
{
new("zh-TW"),
new("Ja-jp")
new("Ja-jp"),
};
});

Expand All @@ -79,8 +79,8 @@ public void TestIsLanguageContainsTranslate()
{
{
new("zh-TW"), "卡拉 OK"
}
}
},
},
});

TriggerHandlerChanged(c =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public void TestRemove()
{
new Lyric
{
SingerIds = { firstSinger.ID }
}
SingerIds = { firstSinger.ID },
},
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ protected override void SetUpKaraokeBeatmap(Action<KaraokeBeatmap> action)
var stageInfo = new TestStageInfo();
karaokeBeatmap.StageInfos = new List<StageInfo>
{
stageInfo
stageInfo,
};
karaokeBeatmap.CurrentStageInfo = stageInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void TestRemove()
var stageInfo = new ClassicStageInfo();
karaokeBeatmap.StageInfos = new List<StageInfo>
{
stageInfo
stageInfo,
};
karaokeBeatmap.CurrentStageInfo = stageInfo;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void TestImport()
new Lyric(),
new Lyric(),
new Note(),
}
},
};
c.Import(beatmap);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void TestLock()
PrepareHitObject(() => new Note
{
Text = "カラオケ",
ReferenceLyricId = referencedLyric.ID
ReferenceLyricId = referencedLyric.ID,
});

TriggerHandlerChanged(c => c.Lock(LockState.Full));
Expand All @@ -51,7 +51,7 @@ public void TestUnlock()
PrepareHitObject(() => new Note
{
Text = "カラオケ",
ReferenceLyricId = referencedLyric.ID
ReferenceLyricId = referencedLyric.ID,
});

TriggerHandlerChanged(c => c.Unlock());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void TestDetectLanguage()
{
PrepareHitObject(() => new Lyric
{
Text = "カラオケ"
Text = "カラオケ",
});

TriggerHandlerChanged(c => c.AutoGenerate());
Expand All @@ -35,7 +35,7 @@ public void TestDetectLanguageWithNonSupportedLyric()
{
PrepareHitObject(() => new Lyric
{
Text = "???"
Text = "???",
});

TriggerHandlerChanged(c => c.AutoGenerate());
Expand Down Expand Up @@ -67,7 +67,7 @@ public void TestSetLanguageToNull()
{
PrepareHitObject(() => new Lyric
{
Text = "???"
Text = "???",
});

TriggerHandlerChanged(c => c.SetLanguage(null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void TestAutoGenerateNotes()
new TimeTag(new TextIndex(2), 2000),
new TimeTag(new TextIndex(3), 3000),
new TimeTag(new TextIndex(3, TextIndex.IndexState.End), 4000),
}
},
});

TriggerHandlerChanged(c => c.AutoGenerate());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void TestCanGenerateWithReferenceLyric()
{
PrepareHitObject(() => new Lyric
{
Text = "karaoke"
Text = "karaoke",
}, false);
}

Expand All @@ -53,7 +53,7 @@ public void TestCanGenerateWithReferenceLyric()
new TimeTag(new TextIndex(2), 2000),
new TimeTag(new TextIndex(3), 3000),
new TimeTag(new TextIndex(3, TextIndex.IndexState.End), 4000),
}
},
});

TriggerHandlerChanged(c =>
Expand All @@ -71,7 +71,7 @@ public void TestGeneratorNotSupportedLyricsWithReferenceLyric()
{
PrepareHitObject(() => new Lyric
{
Text = "karaoke"
Text = "karaoke",
}, false);
}

Expand All @@ -86,7 +86,7 @@ public void TestGeneratorNotSupportedLyricsWithReferenceLyric()
new TimeTag(new TextIndex(2), 2000),
new TimeTag(new TextIndex(3), 3000),
new TimeTag(new TextIndex(3, TextIndex.IndexState.End), 4000),
}
},
});

TriggerHandlerChanged(c =>
Expand All @@ -105,7 +105,7 @@ public void TestAutoGenerate()
{
PrepareHitObject(() => new Lyric
{
Text = "karaoke"
Text = "karaoke",
}, false);
}

Expand All @@ -120,7 +120,7 @@ public void TestAutoGenerate()
new TimeTag(new TextIndex(2), 2000),
new TimeTag(new TextIndex(3), 3000),
new TimeTag(new TextIndex(3, TextIndex.IndexState.End), 4000),
}
},
});

if (lyricReferenceChangeHandler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected Lyric PrepareLyricWithSyncConfig(Lyric referencedLyric, IReferenceLyri
{
ReferenceLyricId = referencedLyric.ID,
ReferenceLyric = referencedLyric,
ReferenceLyricConfig = config ?? new SyncLyricConfig()
ReferenceLyricConfig = config ?? new SyncLyricConfig(),
};

PrepareHitObjects(() => new[] { lyric }, selected);
Expand Down
Loading

0 comments on commit 7f7ed72

Please sign in to comment.