This commit is contained in:
Loup 2025-09-22 22:58:14 -03:00 committed by GitHub
commit 5f51330d62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 4 deletions

View file

@ -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"

View file

@ -0,0 +1,26 @@
# crafted by brostos
import json
plugin_category = ["maps", "minigames", "utilities"]
plugin_names_by_category = {}
for category in plugin_category:
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())
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")