From 8f840ae0b10fc4c5cc5d5b5c3d97ec5fd3ff7183 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 20 Mar 2025 14:11:08 -0700 Subject: [PATCH] refactor: Rename function and emphasize LATEST release in output --- scripts/badges.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/badges.py b/scripts/badges.py index da67d4072..d8b1a6016 100755 --- a/scripts/badges.py +++ b/scripts/badges.py @@ -49,9 +49,9 @@ def get_github_stars(repo="paul-gauthier/aider"): return None -def get_aider_percentage(): +def get_latest_release_aider_percentage(): """ - Get the percentage of code written by Aider in the latest release + Get the percentage of code written by Aider in the LATEST release from the blame.yml file """ blame_path = os.path.join( @@ -66,7 +66,7 @@ def get_aider_percentage(): with open(blame_path, "r") as f: blame_data = yaml.safe_load(f) - # Get the most recent release (first entry in the list) + # The blame data is ordered chronologically, with the most recent release first if blame_data and len(blame_data) > 0: latest_release = blame_data[0] percentage = latest_release.get("aider_percentage", 0) @@ -120,8 +120,8 @@ def main(): print(f"GitHub stars for {args.github_repo}: {stars:,}") # Get Aider contribution percentage in latest release - percentage, version = get_aider_percentage() - print(f"Aider wrote {percentage:.2f}% of code in the latest release ({version})") + percentage, version = get_latest_release_aider_percentage() + print(f"Aider wrote {percentage:.2f}% of code in the LATEST release ({version})") if __name__ == "__main__":