From d25ffa4d054f07cda638071758fb111b7a837e1f Mon Sep 17 00:00:00 2001 From: brostos <67740566+brostosjoined@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:48:13 +0300 Subject: [PATCH 1/5] Switch to Black formatting --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de36220..3052b48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,14 +28,14 @@ jobs: - name: Install Dependencies run: | python -m pip install -U pip - python -m pip install -U pycodestyle==2.12.1 autopep8 + python -m pip install -U black python -m pip install -U -r test/pip_reqs.txt - - name: Apply AutoPEP8 + - name: Apply Black run: | - autopep8 --in-place --recursive --max-line-length=100 . + black . --line-length 80 --skip-string-normalization - - name: Commit AutoPEP8 + - name: Commit Black uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "[ci] auto-format" From 968de341da7d53a25fef1cb77a35a1edaa91dbde Mon Sep 17 00:00:00 2001 From: brostos <67740566+brostosjoined@users.noreply.github.com> Date: Tue, 19 Aug 2025 23:16:09 +0300 Subject: [PATCH 2/5] simple script to update all plugin json --- test/plugman_json_updater.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/plugman_json_updater.py diff --git a/test/plugman_json_updater.py b/test/plugman_json_updater.py new file mode 100644 index 0000000..f6c9834 --- /dev/null +++ b/test/plugman_json_updater.py @@ -0,0 +1,28 @@ +# crafted by brostos +import json + +plugin_category = ["maps", "minigames", "utilities"] +plugin_names_by_category = {} + +for category in plugin_category: + with open(f"{category}.json", "r+") as file: + data = json.load(file) + plugins = data["plugins"] + plugin_names_by_category[category] = list(plugins.keys()) + + for plugin in plugin_names_by_category[category]: + latest_version = int(next(iter(plugins[plugin]["versions"])).replace(".", "")) + current_version = ".".join(str(latest_version + 1)) + plugins[plugin]["versions"][current_version] = None + # Ensure latest version appears first + plugins[plugin]["versions"] = dict( + sorted(plugins[plugin]["versions"].items(), reverse=True) + ) + # json.dump(plugins, indent=2) + file.seek(0) + json.dump(data, file, indent=2, ensure_ascii=False) + # Ensure old content is removed + file.truncate() + print(f"All {category} version have been upgraded") + + From e515f1dee147f8f50e782f85ff58ace32cb4a1cd Mon Sep 17 00:00:00 2001 From: brostosjoined <67740566+brostosjoined@users.noreply.github.com> Date: Tue, 19 Aug 2025 20:16:34 +0000 Subject: [PATCH 3/5] [ci] auto-format --- test/plugman_json_updater.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/plugman_json_updater.py b/test/plugman_json_updater.py index f6c9834..77f0f90 100644 --- a/test/plugman_json_updater.py +++ b/test/plugman_json_updater.py @@ -24,5 +24,3 @@ for category in plugin_category: # Ensure old content is removed file.truncate() print(f"All {category} version have been upgraded") - - From 0369148a153f1977a0695cd3ada586ae2a68c2fc Mon Sep 17 00:00:00 2001 From: brostos <67740566+brostosjoined@users.noreply.github.com> Date: Tue, 19 Aug 2025 23:17:42 +0300 Subject: [PATCH 4/5] Update path --- test/plugman_json_updater.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/plugman_json_updater.py b/test/plugman_json_updater.py index 77f0f90..a26b427 100644 --- a/test/plugman_json_updater.py +++ b/test/plugman_json_updater.py @@ -5,7 +5,7 @@ plugin_category = ["maps", "minigames", "utilities"] plugin_names_by_category = {} for category in plugin_category: - with open(f"{category}.json", "r+") as file: + with open(f"plugins/{category}/{category}.json", "r+") as file: data = json.load(file) plugins = data["plugins"] plugin_names_by_category[category] = list(plugins.keys()) @@ -24,3 +24,4 @@ for category in plugin_category: # Ensure old content is removed file.truncate() print(f"All {category} version have been upgraded") + From d23f3bb30e58392da90319b504fa8f9944065411 Mon Sep 17 00:00:00 2001 From: brostosjoined <67740566+brostosjoined@users.noreply.github.com> Date: Tue, 19 Aug 2025 20:18:02 +0000 Subject: [PATCH 5/5] [ci] auto-format --- test/plugman_json_updater.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/plugman_json_updater.py b/test/plugman_json_updater.py index a26b427..3461fd6 100644 --- a/test/plugman_json_updater.py +++ b/test/plugman_json_updater.py @@ -24,4 +24,3 @@ for category in plugin_category: # Ensure old content is removed file.truncate() print(f"All {category} version have been upgraded") -