Update definitions_test.py

This commit is contained in:
Daniel W. Anner 2023-07-20 11:14:30 -04:00 committed by GitHub
parent 679de8f491
commit a5050ebe41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,9 +59,12 @@ def _get_diff_from_upstream():
# Ensure files are either added, renamed, modified or type changed (do not get deleted files)
CHANGE_TYPE_LIST = ['A', 'R', 'M', 'T']
# Iterate through changed files
for file in changes:
# Ensure the files are modified or added, this will disclude deleted files
if file.change_type in CHANGE_TYPE_LIST:
if 'R' in file.change_type:
# If the file is renamed, ensure we are picking the right schema
if 'R' in file.change_type and path in file.rename_to:
file_list.append((file.rename_to, schema))
elif path in file.a_path:
file_list.append((file.a_path, schema))