Refactor: reformat all code for lefthook using ruff and gofmt (#16585)

This commit is contained in:
Wang Qi
2026-07-03 12:53:39 +08:00
committed by GitHub
parent 19fcb4a981
commit 6a4b9be426
588 changed files with 11123 additions and 15412 deletions

View File

@@ -8,9 +8,7 @@ from common.data_source.models import ExternalAccess
from .models import SerializedRepository
def get_external_access_permission(
repo: Repository, github_client: Github
) -> ExternalAccess:
def get_external_access_permission(repo: Repository, github_client: Github) -> ExternalAccess:
"""
Get the external access permission for a repository.
This functionality requires Enterprise Edition.
@@ -20,9 +18,7 @@ def get_external_access_permission(
return ExternalAccess.empty()
def deserialize_repository(
cached_repo: SerializedRepository, github_client: Github
) -> Repository:
def deserialize_repository(cached_repo: SerializedRepository, github_client: Github) -> Repository:
"""
Deserialize a SerializedRepository back into a Repository object.
"""
@@ -41,4 +37,4 @@ def deserialize_repository(
# If all else fails, re-fetch the repo directly
logging.warning("Failed to deserialize repository: %s. Attempting to re-fetch.", e)
repo_id = cached_repo.id
return github_client.get_repo(repo_id)
return github_client.get_repo(repo_id)