mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
Add python linting in CI with Ruff. Fix the on: push/pull_request for other actions.
This commit is contained in:
parent
c4bccf86ed
commit
751ff67fd9
4 changed files with 36 additions and 7 deletions
1
.github/workflows/autoblack.yml
vendored
1
.github/workflows/autoblack.yml
vendored
|
@ -3,6 +3,7 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
black:
|
||||
name: Check / auto apply black
|
||||
|
|
25
.github/workflows/python_lint.yml
vendored
Normal file
25
.github/workflows/python_lint.yml
vendored
Normal file
|
@ -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'
|
1
.github/workflows/shellcheck.yml
vendored
1
.github/workflows/shellcheck.yml
vendored
|
@ -2,6 +2,7 @@ name: Run Shellcheck on push and PR
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Add table
Reference in a new issue