File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 4848 pattern = '^.{1,5}%s$' % line
4949 regexes .append (re .compile (pattern ))
5050
51- def report_incorrect (file_name , pairs ):
51+ def report_incorrect (file_name , pairs , fail_line ):
5252 # found a problem so report the problem to the caller and exit
5353 print (file_name , "... does not contain a correct copyright notice.\n " )
5454 # print the relevant lines to help the reader find the problem
5555 for (_ , line ) in pairs :
5656 print (" " , line , end = "" )
5757 print ()
58+ if (fail_line != "" ):
59+ print ("Match failed at line:" )
60+ print (" " , fail_line , end = "" )
61+ print ()
5862
5963linecount = 0
6064pairs = []
@@ -69,12 +73,12 @@ def report_incorrect(file_name, pairs):
6973 line = line .rstrip ()
7074 matches = regex .match (line )
7175 if not matches :
72- report_incorrect (file_name , pairs )
76+ report_incorrect (file_name , pairs , line )
7377 exit (1 )
7478
7579if linecount == 0 :
7680 # the file was empty (e.g. dummy.js) so no problem
7781 exit (0 )
7882elif linecount != len (regexes ):
79- report_incorrect (file_name , pairs )
83+ report_incorrect (file_name , pairs , "" )
8084 exit (1 )
You can’t perform that action at this time.
0 commit comments