Merge pull request #165 from ReVanced/pre-commit-ci-update-config

[pre-commit.ci] pre-commit autoupdate
This commit is contained in:
Alexandre Teles (afterSt0rm) 2024-04-09 15:00:01 -03:00 committed by GitHub
commit 09fda8eb6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 37 additions and 23 deletions

View File

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 rev: v4.6.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
@ -12,7 +12,7 @@ repos:
- id: check-toml - id: check-toml
- id: check-merge-conflict - id: check-merge-conflict
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.12.1 rev: 24.3.0
hooks: hooks:
- id: black - id: black
language_version: python3.11 language_version: python3.11

View File

@ -108,9 +108,9 @@ class Github(Backend):
) )
if team_view: if team_view:
filter_contributor[ filter_contributor["keys"] = (
"keys" f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg"
] = f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg" )
return Contributor(**filter_contributor) return Contributor(**filter_contributor)
@ -136,7 +136,9 @@ class Github(Backend):
Returns: Returns:
list[Release]: A list of Release objects. list[Release]: A list of Release objects.
""" """
list_releases_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page={per_page}&page={page}" list_releases_endpoint: str = (
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page={per_page}&page={page}"
)
response: ClientResponse = await http_get( response: ClientResponse = await http_get(
headers=self.headers, url=list_releases_endpoint headers=self.headers, url=list_releases_endpoint
) )
@ -162,7 +164,9 @@ class Github(Backend):
Returns: Returns:
Release: The Release object representing the retrieved release. Release: The Release object representing the retrieved release.
""" """
release_by_tag_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/tags/{tag_name}" release_by_tag_endpoint: str = (
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/tags/{tag_name}"
)
response: ClientResponse = await http_get( response: ClientResponse = await http_get(
headers=self.headers, url=release_by_tag_endpoint headers=self.headers, url=release_by_tag_endpoint
) )
@ -181,7 +185,9 @@ class Github(Backend):
Returns: Returns:
Release: The latest release for the given repository. Release: The latest release for the given repository.
""" """
latest_release_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/latest" latest_release_endpoint: str = (
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/latest"
)
response: ClientResponse = await http_get( response: ClientResponse = await http_get(
headers=self.headers, url=latest_release_endpoint headers=self.headers, url=latest_release_endpoint
) )
@ -200,7 +206,9 @@ class Github(Backend):
Returns: Returns:
Release: The latest pre-release for the given repository. Release: The latest pre-release for the given repository.
""" """
list_releases_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page=10&page=1" list_releases_endpoint: str = (
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page=10&page=1"
)
response: ClientResponse = await http_get( response: ClientResponse = await http_get(
headers=self.headers, url=list_releases_endpoint headers=self.headers, url=list_releases_endpoint
) )
@ -223,7 +231,9 @@ class Github(Backend):
list[Contributor]: A list of contributors for the given repository. list[Contributor]: A list of contributors for the given repository.
""" """
contributors_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/contributors" contributors_endpoint: str = (
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/contributors"
)
response: ClientResponse = await http_get( response: ClientResponse = await http_get(
headers=self.headers, url=contributors_endpoint headers=self.headers, url=contributors_endpoint
) )

View File

@ -9,6 +9,7 @@ Routes:
- GET /patches/<tag:str>: Retrieve a list of patches for a given release tag. - GET /patches/<tag:str>: Retrieve a list of patches for a given release tag.
""" """
import os import os
from sanic import Blueprint, Request from sanic import Blueprint, Request
from sanic.response import JSONResponse, json from sanic.response import JSONResponse, json

View File

@ -21,14 +21,17 @@ class AnnouncementResponseModel(dict):
id=announcement.id, id=announcement.id,
author=announcement.author, author=announcement.author,
title=announcement.title, title=announcement.title,
content=ContentFields( content=(
message=announcement.message, ContentFields(
attachment_urls=[ message=announcement.message,
attachment.attachment_url for attachment in announcement.attachments attachment_urls=[
], attachment.attachment_url
) for attachment in announcement.attachments
if announcement.message or announcement.attachments ],
else None, )
if announcement.message or announcement.attachments
else None
),
channel=announcement.channel, channel=announcement.channel,
created_at=str(announcement.created_at), created_at=str(announcement.created_at),
level=announcement.level, level=announcement.level,

6
app.py
View File

@ -75,9 +75,9 @@ async def add_cache_control(_, response):
@app.on_response @app.on_response
async def add_csp(_, response): async def add_csp(_, response):
response.headers[ response.headers["Content-Security-Policy"] = (
"Content-Security-Policy" "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
] = "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;" )
app.static( app.static(

View File

@ -2,8 +2,8 @@ aiodns==3.1.1 ; (sys_platform == "linux" or sys_platform == "darwin") and python
aiofiles==23.2.1 ; python_version >= "3.11" and python_version < "3.13" aiofiles==23.2.1 ; python_version >= "3.11" and python_version < "3.13"
aiohttp[speedups]==3.9.1 ; python_version >= "3.11" and python_version < "3.13" aiohttp[speedups]==3.9.1 ; python_version >= "3.11" and python_version < "3.13"
aiosignal==1.3.1 ; python_version >= "3.11" and python_version < "3.13" aiosignal==1.3.1 ; python_version >= "3.11" and python_version < "3.13"
argon2-cffi-bindings==21.2.0 ; python_version >= "3.11" and python_version < "3.13"
argon2-cffi==23.1.0 ; python_version >= "3.11" and python_version < "3.13" argon2-cffi==23.1.0 ; python_version >= "3.11" and python_version < "3.13"
argon2-cffi-bindings==21.2.0 ; python_version >= "3.11" and python_version < "3.13"
asyncstdlib==3.12.0 ; python_version >= "3.11" and python_version < "3.13" asyncstdlib==3.12.0 ; python_version >= "3.11" and python_version < "3.13"
attrs==23.2.0 ; python_version >= "3.11" and python_version < "3.13" attrs==23.2.0 ; python_version >= "3.11" and python_version < "3.13"
beautifulsoup4==4.12.2 ; python_version >= "3.11" and python_version < "3.13" beautifulsoup4==4.12.2 ; python_version >= "3.11" and python_version < "3.13"
@ -40,11 +40,11 @@ pyjwt==2.8.0 ; python_version >= "3.11" and python_version < "3.13"
pyseto==1.7.7 ; python_version >= "3.11" and python_version < "3.13" pyseto==1.7.7 ; python_version >= "3.11" and python_version < "3.13"
python-dateutil==2.8.2 ; python_version >= "3.11" and python_version < "3.13" python-dateutil==2.8.2 ; python_version >= "3.11" and python_version < "3.13"
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.13" pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.13"
sanic==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
sanic-beskar==2.3.2 ; python_version >= "3.11" and python_version < "3.13" sanic-beskar==2.3.2 ; python_version >= "3.11" and python_version < "3.13"
sanic-ext==23.12.0 ; python_version >= "3.11" and python_version < "3.13" sanic-ext==23.12.0 ; python_version >= "3.11" and python_version < "3.13"
sanic-limiter @ git+https://github.com/Omegastick/sanic-limiter@843e13144aa21d843ce212a7c1db31b72ce8a103 ; python_version >= "3.11" and python_version < "3.13" sanic-limiter @ git+https://github.com/Omegastick/sanic-limiter@843e13144aa21d843ce212a7c1db31b72ce8a103 ; python_version >= "3.11" and python_version < "3.13"
sanic-routing==23.12.0 ; python_version >= "3.11" and python_version < "3.13" sanic-routing==23.12.0 ; python_version >= "3.11" and python_version < "3.13"
sanic==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
sanic[ext]==23.12.1 ; python_version >= "3.11" and python_version < "3.13" sanic[ext]==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
sentry-sdk[sanic]==1.39.2 ; python_version >= "3.11" and python_version < "3.13" sentry-sdk[sanic]==1.39.2 ; python_version >= "3.11" and python_version < "3.13"
six==1.16.0 ; python_version >= "3.11" and python_version < "3.13" six==1.16.0 ; python_version >= "3.11" and python_version < "3.13"