File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " git-lines-graph"
3- version = " 2.2 .0"
3+ version = " 2.3 .0"
44description = " Git commit lines graph"
55readme = " README.md"
66license = " GPL-3.0-or-later"
Original file line number Diff line number Diff line change 11import argparse
22import os
3+ import logging
34
45import git
56import matplotlib as mpl
67import matplotlib .pyplot as plt
78import pandas as pd
89
10+ logging .getLogger ("matplotlib" ).setLevel (logging .ERROR )
11+
912
1013def main ():
1114 parser = argparse .ArgumentParser ()
@@ -22,7 +25,7 @@ def main():
2225
2326 try :
2427 repo = git .Repo (args .git_dir , search_parent_directories = True )
25- except git .exc .InvalidGitRepositoryError as e :
28+ except git .exc .InvalidGitRepositoryError :
2629 print ("Not part of a valid git project: {}" .format (args .git_dir ))
2730 exit ()
2831
@@ -34,11 +37,12 @@ def main():
3437 data = pd .DataFrame (data , columns = ["date" , "add" , "remove" ])
3538 data ["delta" ] = data ["add" ] - data ["remove" ]
3639 data ["total" ] = data .delta .cumsum ()
37- data .date = pd .to_datetime (data .date )
40+ data .date = pd .to_datetime (data .date , utc = True )
3841 data .set_index (["date" ], inplace = True )
3942
4043 with plt .xkcd ():
41- plt .figure ("Code Lines Progress in project {}" .format (os .path .basename (repo .working_tree_dir )))
44+ plt .figure ()
45+ plt .title ("Code Lines Progress in project {}" .format (os .path .basename (repo .working_tree_dir )), pad = 10 )
4246 plt .ylabel ("# of lines" )
4347 ax = data ["total" ].plot ()
4448 ax .yaxis .set_major_formatter (mpl .ticker .StrMethodFormatter ("{x:,.0f}" ))
You can’t perform that action at this time.
0 commit comments