Skip to content

Commit

Permalink
refactor: Greasy Fork should take precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 committed Mar 4, 2024
1 parent 72fe162 commit 18a2d9c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/best_of/integrations/greasy_fork_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ def update_project_info(self, project_info: Dict) -> None:
)
return

if not project_info.homepage:
# Greasy Fork takes precedence over GitHub.
# A GitHub repository may contain multiple scripts on Greasy Fork,
# therefore Greasy Fork gives more specific metadata.
if (
not project_info.homepage
or project_info.homepage == project_info.github_url
):
project_info.homepage = greasy_fork_info.url

if (
not project_info.description
or len(project_info.description) < MIN_PROJECT_DESC_LENGTH
) and greasy_fork_info.description:
# Greasy Fork takes precedence for the same reason.
if greasy_fork_info.description:
project_info.description = greasy_fork_info.description

if not project_info.license:
Expand Down

0 comments on commit 18a2d9c

Please sign in to comment.