Skip to content

Commit 4adf8de

Browse files
author
MomIsBestFriend
committed
Make the script to not stop on the first occurrence at each file.
1 parent 207b20d commit 4adf8de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/validate_string_concatenation.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ def is_concatenated(file_path):
5151
0 - All good.
5252
1 - Needs to be fixed.
5353
"""
54+
need_fix = False
5455
with open(file_path, "r") as file_name:
5556
toks = list(tokenize.generate_tokens(file_name.readline))
5657
for i in range(len(toks) - 1):
5758
tok = toks[i]
5859
tok2 = toks[i + 1]
5960
if tok[0] == token.STRING and tok[0] == tok2[0]:
61+
need_fix = True
6062
print(
6163
"{file_path}:{line_number}:\t{start} and {end}".format(
6264
file_path=file_path,
@@ -65,8 +67,8 @@ def is_concatenated(file_path):
6567
end=tok2[1],
6668
)
6769
)
68-
return 1
69-
return 0
70+
71+
return(int(need_fix))
7072

7173

7274
if __name__ == "__main__":

0 commit comments

Comments
 (0)