@@ -26,17 +26,17 @@ def parse_args():
2626 parser .add_argument ('-a' , '--all' , dest = 'all' ,
2727 help = 'Show all bugs squashed' , action = 'store_true' )
2828 parser .add_argument ('-t' , '--token' , dest = 'tokenfile' ,
29- help = 'File containing GitHub token' , metavar = 'FILE' )
30- parser .add_argument ('-b ' , '--begin ' , dest = 'begin ' , help = 'begin date (YYYY-mm-dd)' ,
31- metavar = 'date ' , type = valid_date_type , required = True )
29+ help = 'File containing GitHub token (alternatively, use GITHUB_TOKEN env variable) ' , metavar = 'FILE' )
30+ parser .add_argument ('-s ' , '--start ' , dest = 'start ' , help = 'start date (YYYY-mm-dd)' ,
31+ metavar = 'START_DATE ' , type = valid_date_type , required = True )
3232 parser .add_argument ('-e' , '--end' , dest = 'end' , help = 'end date (YYYY-mm-dd)' ,
33- metavar = 'date ' , type = valid_date_type , required = True )
33+ metavar = 'END_DATE ' , type = valid_date_type , required = True )
3434
3535 args = parser .parse_args ()
3636
37- if args .end < args .begin :
37+ if args .end < args .start :
3838 raise ValueError (
39- 'end date {} is before begin date {}' .format (args .end , args .begin ))
39+ 'end date {} is before start date {}' .format (args .end , args .start ))
4040
4141 if args .tokenfile :
4242 with open (args .tokenfile , 'r' ) as file :
@@ -53,12 +53,12 @@ def parse_args():
5353
5454
5555class BugBashTally (object ):
56- def __init__ (self , gh , begin_date , end_date ):
56+ def __init__ (self , gh , start_date , end_date ):
5757 """Create a BugBashTally object with the provided Github object,
58- begin datetime object, and end datetime object"""
58+ start datetime object, and end datetime object"""
5959 self ._gh = gh
6060 self ._repo = gh .get_repo ('zephyrproject-rtos/zephyr' )
61- self ._begin_date = begin_date
61+ self ._start_date = start_date
6262 self ._end_date = end_date
6363
6464 self ._issues = []
@@ -122,12 +122,12 @@ def get_issues(self):
122122
123123 cutoff = self ._end_date + timedelta (1 )
124124 issues = self ._repo .get_issues (state = 'closed' , labels = [
125- 'bug' ], since = self ._begin_date )
125+ 'bug' ], since = self ._start_date )
126126
127127 for i in issues :
128128 # the PyGithub API and v3 REST API do not facilitate 'until'
129129 # or 'end date' :-/
130- if i .closed_at < self ._begin_date or i .closed_at > cutoff :
130+ if i .closed_at < self ._start_date or i .closed_at > cutoff :
131131 continue
132132
133133 ipr = i .pull_request
@@ -167,7 +167,7 @@ def print_top_ten(top_ten):
167167
168168def main ():
169169 args = parse_args ()
170- bbt = BugBashTally (Github (args .token ), args .begin , args .end )
170+ bbt = BugBashTally (Github (args .token ), args .start , args .end )
171171 if args .all :
172172 # print one issue per line
173173 issues = bbt .get_issues ()
0 commit comments