mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
Added grand total line count summary across all Python files.
This commit is contained in:
parent
1a9adca83c
commit
0153a18bff
1 changed files with 8 additions and 0 deletions
|
@ -8,6 +8,7 @@ from collections import defaultdict
|
|||
from pathlib import Path
|
||||
from aider.dump import dump
|
||||
import os
|
||||
from operator import itemgetter
|
||||
|
||||
|
||||
def get_all_commit_hashes_since_tag(tag):
|
||||
|
@ -54,12 +55,19 @@ def main():
|
|||
py_files = run(['git', 'ls-files', '*.py']).strip().split('\n')
|
||||
|
||||
all_file_counts = {}
|
||||
grand_total = defaultdict(int)
|
||||
for file in py_files:
|
||||
file_counts = get_counts_for_file(args.tag, authors, file)
|
||||
if file_counts:
|
||||
all_file_counts[file] = file_counts
|
||||
for author, count in file_counts.items():
|
||||
grand_total[author] += count
|
||||
|
||||
dump(all_file_counts)
|
||||
|
||||
print("\nGrand Total:")
|
||||
for author, count in sorted(grand_total.items(), key=itemgetter(1), reverse=True):
|
||||
print(f"{author}: {count}")
|
||||
|
||||
def get_counts_for_file(tag, authors, fname):
|
||||
text = run(['git', 'blame', f'{tag}..HEAD', '--', fname])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue