-
Notifications
You must be signed in to change notification settings - Fork 10
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
Code churn per file #17
base: main
Are you sure you want to change the base?
Conversation
* Minor tweaks to Formatting * Added a section about contribution * Added section about how to test * Added a few words about present and future organization
* Left all existing code in place * Created two new functions to make more modular and easier to test * Moved a few lines of existing code into those two new functions
Updated internal calculations to track both lines added and removed while matching the original contribution and churn calculations Additionally, file change counts were manually reviewed to ensure their correctness.
* Refactored existing code to track line add and line removal * Made sure the code remained true to original churn and contributions counts
|
||
def get_loc(commit, dir, files, contribution, churn, exdir): | ||
# git show automatically excludes binary file changes | ||
command = 'git show --format= --unified=0 --no-prefix ' + commit | ||
if len(exdir) > 1: | ||
# https://stackoverflow.com/a/21079437 | ||
command += ' -- . ":(exclude,icase)'+exdir+'"' | ||
results = get_proc_out(command, dir).splitlines() | ||
results = get_commit_results(command, dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NewMountain I guess this method definition is missing..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, I also get this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how I missed this 🤦 . Let me get this sorted out and update.
@vvaishakh1 @olleharstedt . Forgot a function. Added that in. Everything passes on my end. I apologize for the confusion. |
import argparse | ||
import datetime | ||
import os | ||
import shlex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparently shlex is not used in the project anywhere
Changes internal data structure of
files
to track the lines added/removed per line in files and a command line argument to optionally pretty-print the result.Leverages the test suite added in PR 15.
This PR will satisfy issues 16 and 13