@@ -32,7 +32,7 @@ def typecheck_files(filenames):
32
32
my_report [filename ].errors += 1
33
33
elif severity == "warning" :
34
34
my_report [filename ].warnings += 1
35
- start = diagnostic [ "range" ] ["start" ]
35
+ start = diagnostic . get ( "range" , { "start" : { "line" : 1 , "character" : 1 }}) ["start" ]
36
36
my_report [filename ].diagnostics .append ((start ["line" ], start ["character" ], severity , diagnostic ["message" ]))
37
37
38
38
for report in my_report .values ():
@@ -48,10 +48,10 @@ def typecheck_diff(rev1, rev2):
48
48
print ()
49
49
filenames = subprocess .check_output (["git" , "diff" , "--name-only" , f"{ rev1 } ...{ rev2 } " ], text = True ).splitlines ()
50
50
filenames = filter_py (filenames )
51
- subprocess .check_call (["git" , "checkout" , rev1 ], stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
52
- report1 = typecheck_files (filenames )
53
51
subprocess .check_call (["git" , "checkout" , rev2 ], stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
54
52
report2 = typecheck_files (filenames )
53
+ subprocess .check_call (["git" , "checkout" , rev1 ], stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
54
+ report1 = typecheck_files (report2 )
55
55
56
56
status = 0
57
57
0 commit comments