Skip to content

Commit 0c5b721

Browse files
📝 CodeRabbit Chat: Implement requested code changes
1 parent 0b3eea6 commit 0c5b721

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

build-checks.py

100755100644
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
def read_csv_rows(filepath: str) -> Iterator[List[str]]:
3333
"""Yield rows from a CSV file, skipping the header."""
34-
with open(filepath, "r") as csvfile:
34+
with open(filepath, "r", newline="") as csvfile:
3535
reader = csv.reader(csvfile)
3636
next(reader, None) # Skip header
3737
for row in reader:
@@ -74,7 +74,7 @@ def checkFilesInSoundsNotInCSV() -> int:
7474
referenced_files = set()
7575
for f in csv_directory.glob("*.csv"):
7676
for row in read_csv_rows(str(f)):
77-
if len(row) == 6:
77+
if len(row) >= 6:
7878
fname = row[5].strip()
7979
if fname:
8080
referenced_files.add(fname)
@@ -133,7 +133,6 @@ def checkFilenameLengthsInCSV() -> int:
133133
if f.name.endswith("_scripts.csv"):
134134
continue
135135
for row in read_csv_rows(str(f)):
136-
row = [field.strip().strip('"') for field in row]
137136
if len(row) == 6:
138137
filename_in_csv = row[5].strip()
139138
if len(Path(filename_in_csv).stem) > 8:
@@ -315,4 +314,4 @@ def checkSequentialStringIDs() -> int:
315314
if error_count > 0:
316315
sys.exit(EX_DATAERR)
317316
else:
318-
sys.exit(EX_OK)
317+
sys.exit(EX_OK)

0 commit comments

Comments
 (0)