Skip to content

Commit

Permalink
Merge pull request #165 from ReVanced/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
alexandreteles authored Apr 9, 2024
2 parents b2c2fa7 + 0538e69 commit 09fda8e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,7 +12,7 @@ repos:
- id: check-toml
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.3.0
hooks:
- id: black
language_version: python3.11
Expand Down
26 changes: 18 additions & 8 deletions api/backends/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ async def __assemble_contributor(
)

if team_view:
filter_contributor[
"keys"
] = f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg"
filter_contributor["keys"] = (
f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg"
)

return Contributor(**filter_contributor)

Expand All @@ -136,7 +136,9 @@ async def list_releases(
Returns:
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(
headers=self.headers, url=list_releases_endpoint
)
Expand All @@ -162,7 +164,9 @@ async def get_release_by_tag_name(
Returns:
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(
headers=self.headers, url=release_by_tag_endpoint
)
Expand All @@ -181,7 +185,9 @@ async def get_latest_release(
Returns:
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(
headers=self.headers, url=latest_release_endpoint
)
Expand All @@ -200,7 +206,9 @@ async def get_latest_pre_release(
Returns:
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(
headers=self.headers, url=list_releases_endpoint
)
Expand All @@ -223,7 +231,9 @@ async def get_contributors(self, repository: GithubRepository) -> list[Contribut
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(
headers=self.headers, url=contributors_endpoint
)
Expand Down
1 change: 1 addition & 0 deletions api/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- GET /patches/<tag:str>: Retrieve a list of patches for a given release tag.
"""

import os
from sanic import Blueprint, Request
from sanic.response import JSONResponse, json
Expand Down
19 changes: 11 additions & 8 deletions api/models/announcements.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ def to_response(announcement: AnnouncementDbModel):
id=announcement.id,
author=announcement.author,
title=announcement.title,
content=ContentFields(
message=announcement.message,
attachment_urls=[
attachment.attachment_url for attachment in announcement.attachments
],
)
if announcement.message or announcement.attachments
else None,
content=(
ContentFields(
message=announcement.message,
attachment_urls=[
attachment.attachment_url
for attachment in announcement.attachments
],
)
if announcement.message or announcement.attachments
else None
),
channel=announcement.channel,
created_at=str(announcement.created_at),
level=announcement.level,
Expand Down
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ async def add_cache_control(_, response):

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


app.static(
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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"
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-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"
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"
Expand Down Expand Up @@ -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"
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"
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-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-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"
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"
Expand Down

0 comments on commit 09fda8e

Please sign in to comment.