File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 48
48
pattern = '^.{1,5}%s$' % line
49
49
regexes .append (re .compile (pattern ))
50
50
51
- def report_incorrect (file_name , pairs ):
51
+ def report_incorrect (file_name , pairs , fail_line ):
52
52
# found a problem so report the problem to the caller and exit
53
53
print (file_name , "... does not contain a correct copyright notice.\n " )
54
54
# print the relevant lines to help the reader find the problem
55
55
for (_ , line ) in pairs :
56
56
print (" " , line , end = "" )
57
57
print ()
58
+ if (fail_line != "" ):
59
+ print ("Match failed at line:" )
60
+ print (" " , fail_line , end = "" )
61
+ print ()
58
62
59
63
linecount = 0
60
64
pairs = []
@@ -69,12 +73,12 @@ def report_incorrect(file_name, pairs):
69
73
line = line .rstrip ()
70
74
matches = regex .match (line )
71
75
if not matches :
72
- report_incorrect (file_name , pairs )
76
+ report_incorrect (file_name , pairs , line )
73
77
exit (1 )
74
78
75
79
if linecount == 0 :
76
80
# the file was empty (e.g. dummy.js) so no problem
77
81
exit (0 )
78
82
elif linecount != len (regexes ):
79
- report_incorrect (file_name , pairs )
83
+ report_incorrect (file_name , pairs , "" )
80
84
exit (1 )
You can’t perform that action at this time.
0 commit comments