diff --git a/.github/workflows/autoblack.yml b/.github/workflows/autoblack.yml index 761222b..8a1da50 100644 --- a/.github/workflows/autoblack.yml +++ b/.github/workflows/autoblack.yml @@ -1,8 +1,9 @@ name: Check / auto apply Black on: push: - branches: - - master + branches: + - master + jobs: black: name: Check / auto apply black diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml new file mode 100644 index 0000000..b84305a --- /dev/null +++ b/.github/workflows/python_lint.yml @@ -0,0 +1,25 @@ +name: Python Ruff Lint and commit + +on: + push: + branches: [master] + pull_request: + +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + - name: Install Ruff + run: pip install ruff + + - name: Ruff check and fix + run: | + ruff check . + ruff fix . + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'Python style fixes from Ruff' diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index d4e239c..e6e5d05 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -2,6 +2,7 @@ name: Run Shellcheck on push and PR on: push: + branches: [master] pull_request: jobs: diff --git a/custom-catalog/catalog_manager.py b/custom-catalog/catalog_manager.py index 09baab7..b8a14b5 100755 --- a/custom-catalog/catalog_manager.py +++ b/custom-catalog/catalog_manager.py @@ -1,13 +1,14 @@ #!/usr/bin/python3 -import sys -import os import json -import toml -import yaml +import os +import sys import time from collections import OrderedDict +import toml +import yaml + CATALOG_LIST_PATH = "/etc/yunohost/apps_catalog.yml" assert os.path.exists( CATALOG_LIST_PATH @@ -44,7 +45,8 @@ def build(folder=DEFAULT_APPS_FOLDER): apps[app_dict["id"]] = app_dict - # We also remove the app install question and resources parts which aint needed anymore by webadmin etc (or at least we think ;P) + # We also remove the app install question and resources parts which aint needed + # anymore by webadmin etc (or at least we think ;P) for app in apps.values(): if "manifest" in app and "install" in app["manifest"]: del app["manifest"]["install"]