mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 17:28:57 +00:00
Add python format and lint CI
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {} \;
|
||||
Reference in New Issue
Block a user