Skip to content

Commit

Permalink
only typecheck python files...
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmot committed Jan 24, 2025
1 parent d79a74a commit 519a8fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ci-image/scripts/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ def typecheck_files(filenames):

return my_report

def filter_py(names):
return [name for name in names if name.endswith('.py') or name.endswith('.pyi')]

def typecheck_diff(rev1, rev2):
print(f"Comparing {rev1} --> {rev2}")
print()
filenames = subprocess.check_output(["git", "diff", "--name-only", f"{rev1}...{rev2}"], text=True).splitlines()
filenames = filter_py(filenames)
subprocess.check_call(["git", "checkout", rev1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
report1 = typecheck_files(filenames)
subprocess.check_call(["git", "checkout", rev2], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
Expand Down

0 comments on commit 519a8fe

Please sign in to comment.