Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add stats command to allow user to compare aider usage across different revision #2883

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josix
Copy link

@josix josix commented Jan 16, 2025

TODO:

  • Implementation
  • E2E Test
  • Unit Test

This pull request introduces a new feature to show code change statistics between revisions and refactors existing code to support this functionality. The most important changes include adding a new command, updating argument parsing, and refactoring common functions into a new module.

New Feature: Code Change Statistics

  • Added --stats argument to show code change statistics between revisions in aider/args.py.
  • Implemented cmd_stats method to calculate and display code change statistics in aider/commands.py.
  • Added logic to handle --stats argument in aider/main.py.

Refactoring for Code Reuse

  • Moved functions hash_len, get_all_commit_hashes_between_tags, get_commit_authors, and get_counts_for_file to a new module aider/stats.py for reuse.

Codebase Simplification

  • Updated imports in aider/commands.py and scripts/blame.py to use refactored functions from aider/stats.py. [1] [2]
  • Removed redundant functions from scripts/blame.py after refactoring. [1] [2]

Example

aider --env-file ~/aider/.env --stats v0.69.0..v0.71.0
Aider v0.71.2.dev21+g620ae5cf.d20250116
Main model: claude-3-5-sonnet-20241022 with diff edit format, infinite output
Weak model: claude-3-5-haiku-20241022
Git repo: .git with 426 files
Repo-map: using 4096 tokens, auto refresh
Found 109 non-binary tracked files in the repository.

Analysis from v0.69.0 to v0.71.0:
Total lines analyzed: 6,440
Lines by aider: 1,147 (17.8%)
Lines by humans: 5,293 (82.2%)

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2025

CLA assistant check
All committers have signed the CLA.

@josix josix changed the title Add stats command to allow user to compare aider usage across different revision feat: Add stats command to allow user to compare aider usage across different revision Jan 16, 2025
@MrOrz
Copy link

MrOrz commented Jan 24, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants