Allow empty lines in arbitrary config schedules (#6654)

This change is a precursor to attempts to add more editorconfig rules in
our codebase. It is a good idea to comply with POSIX standards and have
an empty newline at the end of text files. However, once we have such a
rule, arbitrary configs scripts used to fail before this change.

Related: #5981
pull/6675/head
Hanefi Onaldi 2023-01-30 16:30:12 +03:00 committed by GitHub
parent a9e1b98973
commit 0962cf7517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -125,7 +125,11 @@ def copy_test_files(config):
with open(scheduleName) as file: with open(scheduleName) as file:
lines = file.readlines() lines = file.readlines()
for line in lines: for line in lines:
colon_index = line.index(":") colon_index = line.find(":")
# skip empty lines
if colon_index == -1:
continue
line = line[colon_index + 1 :].strip() line = line[colon_index + 1 :].strip()
test_names = line.split(" ") test_names = line.split(" ")
copy_test_files_with_names(test_names, sql_dir_path, expected_dir_path, config) copy_test_files_with_names(test_names, sql_dir_path, expected_dir_path, config)