Skip to content

Commit cbd4e68

Browse files
authored
Merge pull request #32 from lulusuki/indev
CI workflow & linting
2 parents bfe1538 + b25c0cd commit cbd4e68

87 files changed

Lines changed: 2579 additions & 2528 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
workflow_dispatch:
7+
8+
jobs:
9+
dotnet-format:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
14+
- name: Setup
15+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
16+
with:
17+
dotnet-version: 10.0.x
18+
19+
- name: Restore dependencies
20+
run: dotnet restore
21+
- name: Format
22+
run: dotnet format --verify-no-changes Rhythia.csproj

scripts/Constants.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ public partial class Constants : Node
66
{
77
public static readonly ulong STARTED = Time.GetTicksUsec();
88

9-
public static readonly string ROOT_FOLDER = Directory.GetCurrentDirectory();
10-
11-
public static readonly string USER_FOLDER = OS.GetUserDataDir();
9+
public static readonly string ROOT_FOLDER = Directory.GetCurrentDirectory();
10+
11+
public static readonly string USER_FOLDER = OS.GetUserDataDir();
1212

1313
public static readonly string DEFAULT_MAP_EXT = "phxm";
1414

1515
public static readonly bool TEMP_MAP_MODE = false;//OS.GetCmdlineArgs().Length > 0;
1616

17-
public static readonly double CURSOR_SIZE = 0.2625;
17+
public static readonly double CURSOR_SIZE = 0.2625;
1818

19-
public static readonly double GRID_SIZE = 3.0;
19+
public static readonly double GRID_SIZE = 3.0;
2020

21-
public static readonly Vector2 BOUNDS = new((float)(GRID_SIZE / 2 - CURSOR_SIZE / 2), (float)(GRID_SIZE / 2 - CURSOR_SIZE / 2));
21+
public static readonly Vector2 BOUNDS = new((float)(GRID_SIZE / 2 - CURSOR_SIZE / 2), (float)(GRID_SIZE / 2 - CURSOR_SIZE / 2));
2222

23-
public static readonly double HIT_BOX_SIZE = 0.07;
23+
public static readonly double HIT_BOX_SIZE = 0.07;
2424

25-
public static readonly double HIT_WINDOW = 55;
25+
public static readonly double HIT_WINDOW = 55;
2626

27-
public static readonly int BREAK_TIME = 4000; // used for skipping breaks mid-map
27+
public static readonly int BREAK_TIME = 4000; // used for skipping breaks mid-map
2828

29-
public static readonly string[] DIFFICULTIES = ["N/A", "Easy", "Medium", "Hard", "Insane", "Illogical"];
29+
public static readonly string[] DIFFICULTIES = ["N/A", "Easy", "Medium", "Hard", "Insane", "Illogical"];
3030

31-
public static readonly Color[] DIFFICULTY_COLORS = [Color.FromHtml("ffffff"), Color.FromHtml("77f379"), Color.FromHtml("fff832"), Color.FromHtml("e24479"), Color.FromHtml("9d6eff"), Color.FromHtml("0094fc")];
31+
public static readonly Color[] DIFFICULTY_COLORS = [Color.FromHtml("ffffff"), Color.FromHtml("77f379"), Color.FromHtml("fff832"), Color.FromHtml("e24479"), Color.FromHtml("9d6eff"), Color.FromHtml("0094fc")];
3232

33-
public static readonly Godot.Collections.Dictionary<string, double> MODS_MULTIPLIER_INCREMENT = new()
34-
{
35-
["NoFail"] = 0,
36-
["Ghost"] = 0.0675,
37-
// ["Spin"] = 0.18,
38-
// ["Flashlight"] = 0.1,
39-
// ["Chaos"] = 0.07,
40-
// ["HardRock"] = 0.08
41-
};
33+
public static readonly Godot.Collections.Dictionary<string, double> MODS_MULTIPLIER_INCREMENT = new()
34+
{
35+
["NoFail"] = 0,
36+
["Ghost"] = 0.0675,
37+
// ["Spin"] = 0.18,
38+
// ["Flashlight"] = 0.1,
39+
// ["Chaos"] = 0.07,
40+
// ["HardRock"] = 0.08
41+
};
4242
}

scripts/FileInitializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private void deepCopy(string resDir = "")
7373
break;
7474
case "ArrayMesh":
7575
objExporter.Call("save_mesh_to_files", resource, userDir, resFile.Replace(".obj", ""));
76-
continue;
76+
continue;
7777
default:
7878
Logger.Error($"[{resFile}] {resource.GetType().Name} is not supported for the user folder.");
7979
continue;

scripts/KeybindsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public override void _Ready()
1111
wikiPopup = new("Open Wiki", string.Format(LinkPopupButton.InfoTemplate, wikiLink));
1212

1313
wikiPopup.AddOption("Open", Callable.From(() => { OS.ShellOpen(wikiLink); }), wikiLink);
14-
wikiPopup.AddOption("Cancel", Callable.From(wikiPopup.Hide));
14+
wikiPopup.AddOption("Cancel", Callable.From(wikiPopup.Hide));
1515
}
1616

1717
public override void _Input(InputEvent @event)

scripts/Rhythia.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public override async void _Ready()
7575

7676
Stats.GamesOpened++;
7777

78-
78+
7979
// marking sspms for importing can be done with an one liner, kept the following block of code in case we need to loop over every valid map file for some reason
8080

8181
// List<string> import = [];
@@ -94,14 +94,15 @@ public override async void _Ready()
9494

9595
var nonPhxmMaps = Directory.EnumerateFiles($"{Constants.USER_FOLDER}/maps", $"*.*", SearchOption.AllDirectories).Where(f => f.GetExtension().ToLower() == "sspm" || f.GetExtension().ToLower() == "txt");
9696
await MapParser.BulkImport([.. nonPhxmMaps], notify: true);
97-
97+
9898
// delete after importing
9999
foreach (string file in nonPhxmMaps)
100100
{
101101
File.Delete(file);
102102
}
103103

104-
GetViewport().Connect("files_dropped", Callable.From((string[] files) => {
104+
GetViewport().Connect("files_dropped", Callable.From((string[] files) =>
105+
{
105106
EmitSignal(SignalName.FilesDropped, files);
106107

107108
List<string> maps = [];

scripts/SceneManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public static void Load(string path, bool skipTransition = false)
5959
outTween.TweenProperty(Scene.Transition, "self_modulate", Color.FromHtml("ffffffff"), skipTransition ? 0 : 0.25);
6060
}
6161

62-
outTween.TweenCallback(Callable.From(() => {
62+
outTween.TweenCallback(Callable.From(() =>
63+
{
6364
removeScene(Scene);
6465

6566
activeScenePath = path;

scripts/SettingsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static void Load(string profile = null)
8787
ToastNotification.Notify($"Could not find skin {Instance.Settings.Skin.Value}", 1);
8888
}
8989

90-
void addUserContentToSettingsList(SettingsItem<string> settingsItem, IEnumerable<string> options)
90+
static void addUserContentToSettingsList(SettingsItem<string> settingsItem, IEnumerable<string> options)
9191
{
9292
foreach (string option in options)
9393
{
@@ -143,7 +143,7 @@ public static void ResetToDefaults()
143143

144144
SettingsProfile defaults = new SettingsProfile();
145145

146-
foreach(var property in typeof(SettingsProfile).GetProperties())
146+
foreach (var property in typeof(SettingsProfile).GetProperties())
147147
{
148148
if (!typeof(ISettingsItem).IsAssignableFrom(property.PropertyType)) continue;
149149

scripts/SoundManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public override void _Ready()
6666

6767
SettingsManager.Instance.Loaded += UpdateVolume;
6868
Lobby.Instance.SpeedChanged += (speed) => { SoundManager.Song.PitchScale = (float)speed; };
69-
MapManager.Selected.ValueChanged += (_, selected) => {
69+
MapManager.Selected.ValueChanged += (_, selected) =>
70+
{
7071
var map = selected.Value;
7172

7273
if (Map == null || Map.Name != map.Name)

scripts/database/Config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class Config
1313
/// </summary>
1414
public string SettingsProfileID { get; set; }
1515

16-
private Config Default()
16+
private Config init()
1717
{
1818
return new Config();
1919
}

scripts/database/settings/ISettingsItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ public interface ISettingsItem
2828

2929
bool Visible { get; }
3030

31-
bool SaveToDisk { get; }
31+
bool SaveToDisk { get; }
3232
}

0 commit comments

Comments
 (0)