mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-04-28 12:27:59 +03:00
Added more information on progress bot (#65)
This commit is contained in:
parent
d00cff570a
commit
bd920b9b6e
1 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
from progress import *
|
||||
import requests
|
||||
import argparse
|
||||
from git import Repo
|
||||
|
||||
repo = Repo('.')
|
||||
|
||||
def main(args):
|
||||
func_sizes, total_size = get_func_sizes()
|
||||
|
@ -18,11 +21,17 @@ def main(args):
|
|||
funcs_matching_ratio = (len(matching_funcs) / len(all_funcs)) * 100
|
||||
matching_ratio = (matching_size / total_size) * 100
|
||||
|
||||
commit = repo.heads.master.commit
|
||||
|
||||
content = {
|
||||
"embeds": [{
|
||||
"description": f"**{len(matching_funcs)}** matched functions / **{len(all_funcs)}** total (**{funcs_matching_ratio:.2f}%**)\n**{matching_size}** matching bytes / **{total_size}** total (**{matching_ratio:.2f}%**)"
|
||||
"title": f"{commit.message.splitlines()[0]}",
|
||||
"description": f"**{len(matching_funcs)}** matched functions / **{len(all_funcs)}** total (**{funcs_matching_ratio:.2f}%**)\n**{matching_size}** matching bytes / **{total_size}** total (**{matching_ratio:.2f}%**)",
|
||||
"url": f"https://github.com/sonicdcer/sf64/commit/{commit.hexsha}",
|
||||
"color": commit.authored_date & 0xFFFFFF
|
||||
}]
|
||||
}
|
||||
|
||||
requests.post(args.discord_url, json=content)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue