Add python format and lint CI

This commit is contained in:
bbhtt
2024-11-07 14:02:10 +05:30
parent 1c29aa60d5
commit bf42f138a0
4 changed files with 28 additions and 4 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ from gql import Client, gql
from gql.transport.requests import RequestsHTTPTransport
gi.require_version("Json", "1.0")
from gi.repository import Json # noqa: E402
from gi.repository import Json # noqa: E402
def set_protected_branch(token, repo, branch):
-1
View File
@@ -48,7 +48,6 @@ def get_eol_refs(arch: str, remote: str) -> set:
def main() -> None:
token = os.environ["GITHUB_TOKEN"]
g = github.Github(auth=github.Auth.Token(token))
+1 -2
View File
@@ -10,13 +10,12 @@ from github.GithubException import (
def main() -> None:
token = os.environ["GITHUB_TOKEN"]
g = github.Github(auth=github.Auth.Token(token))
org = g.get_organization("flathub")
excludes = {}
# excludes = {}
earliest = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(
weeks=60
+26
View File
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches: master
pull_request:
branches: master
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: pip install --user ruff
- name: Check format
run: find .github -name *.py -exec ruff format --check {} \;
- name: Lint
run: find .github -name *.py -exec ruff check --output-format=github {} \;