1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

Add autopep8 configuration and integrate into workflows for code formatting

This commit is contained in:
mr. M 2025-01-12 16:57:34 +01:00
parent 838569e386
commit 225ab67a50
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
9 changed files with 156 additions and 99 deletions

View file

@ -1,12 +1,14 @@
import os
import json
def update_ff():
"""Runs the npm command to update the 'ff' component."""
result = os.system("npm run update-ff:raw")
if result != 0:
raise RuntimeError("Failed to update 'ff' component.")
def get_version_from_file(filename):
"""Retrieves the version from the specified JSON file."""
try:
@ -16,6 +18,7 @@ def get_version_from_file(filename):
except (FileNotFoundError, json.JSONDecodeError) as e:
raise RuntimeError(f"Error reading version from {filename}: {e}")
def update_readme(last_version, new_version):
"""Updates the README.md file to reflect the new version."""
try:
@ -28,6 +31,7 @@ def update_readme(last_version, new_version):
except FileNotFoundError as e:
raise RuntimeError(f"README.md file not found: {e}")
def main():
"""Main function to update versions and README."""
try:
@ -35,9 +39,11 @@ def main():
update_ff()
new_version = get_version_from_file("surfer.json")
update_readme(last_version, new_version)
print(f"Updated version from {last_version} to {new_version} in README.md.")
print(
f"Updated version from {last_version} to {new_version} in README.md.")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
main()