mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
Refactor the code in the if args.all_since
block into a new function process_all_tags_since
.
This commit is contained in:
parent
074aeb5048
commit
77022a9729
1 changed files with 19 additions and 15 deletions
|
@ -73,15 +73,8 @@ def get_commit_authors(commits):
|
||||||
|
|
||||||
hash_len = len('44e6fefc2')
|
hash_len = len('44e6fefc2')
|
||||||
|
|
||||||
def main():
|
def process_all_tags_since(start_tag):
|
||||||
parser = argparse.ArgumentParser(description="Get aider/non-aider blame stats")
|
tags = get_all_tags_since(start_tag)
|
||||||
parser.add_argument("start_tag", help="The tag to start from")
|
|
||||||
parser.add_argument("--end-tag", help="The tag to end at (default: HEAD)", default=None)
|
|
||||||
parser.add_argument("--all-since", action="store_true", help="Find all tags since the specified tag and print aider percentage between each pair of successive tags")
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
if args.all_since:
|
|
||||||
tags = get_all_tags_since(args.start_tag)
|
|
||||||
tags += ['HEAD']
|
tags += ['HEAD']
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
|
@ -96,6 +89,17 @@ def main():
|
||||||
'aider_lines': aider_total,
|
'aider_lines': aider_total,
|
||||||
'total_lines': total_lines
|
'total_lines': total_lines
|
||||||
})
|
})
|
||||||
|
return results
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description="Get aider/non-aider blame stats")
|
||||||
|
parser.add_argument("start_tag", help="The tag to start from")
|
||||||
|
parser.add_argument("--end-tag", help="The tag to end at (default: HEAD)", default=None)
|
||||||
|
parser.add_argument("--all-since", action="store_true", help="Find all tags since the specified tag and print aider percentage between each pair of successive tags")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.all_since:
|
||||||
|
results = process_all_tags_since(args.start_tag)
|
||||||
print(yaml.dump(results, sort_keys=False))
|
print(yaml.dump(results, sort_keys=False))
|
||||||
else:
|
else:
|
||||||
all_file_counts, grand_total, total_lines, aider_total, aider_percentage, end_date = blame(args.start_tag, args.end_tag)
|
all_file_counts, grand_total, total_lines, aider_total, aider_percentage, end_date = blame(args.start_tag, args.end_tag)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue