Skip to content

Commit

Permalink
update hen and implement new colors
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Apr 15, 2024
1 parent 315bac6 commit 13a9896
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 90 deletions.
13 changes: 9 additions & 4 deletions jg/chick/lib/reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

LINKEDIN_URL_RE = re.compile(r"linkedin\.com/in/(?P<username>[^\s\/]+)")

COLORS = {
ResultType.ERROR: Color.red(),
ResultType.WARNING: Color.orange(),
ResultType.INFO: Color.blue(),
ResultType.DONE: Color.green(),
}


def find_github_url(text: str) -> str | None:
if match := GITHUB_URL_RE.search(text):
Expand Down Expand Up @@ -46,9 +53,7 @@ def format_summary(summary: Summary) -> Generator[dict[str, Any], None, None]:
yield dict(content="🔬 Tak jsem kouklo na ten GitHub.")
for result in summary.results:
embed = Embed(
color=(
Color.green() if result.type == ResultType.DONE else Color.orange()
),
description=f"{result.message}\n[Další info]({result.docs_url})",
color=COLORS[result.type],
description=f"{result.message}\nℹ️ [Vysvětlení]({result.docs_url})",
)
yield dict(embed=embed)
Loading

0 comments on commit 13a9896

Please sign in to comment.