We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 207b20d commit d920bfdCopy full SHA for d920bfd
scripts/validate_string_concatenation.py
@@ -51,12 +51,14 @@ def is_concatenated(file_path):
51
0 - All good.
52
1 - Needs to be fixed.
53
"""
54
+ need_fix = False
55
with open(file_path, "r") as file_name:
56
toks = list(tokenize.generate_tokens(file_name.readline))
57
for i in range(len(toks) - 1):
58
tok = toks[i]
59
tok2 = toks[i + 1]
60
if tok[0] == token.STRING and tok[0] == tok2[0]:
61
+ need_fix = True
62
print(
63
"{file_path}:{line_number}:\t{start} and {end}".format(
64
file_path=file_path,
@@ -65,8 +67,8 @@ def is_concatenated(file_path):
65
67
end=tok2[1],
66
68
)
69
- return 1
- return 0
70
+
71
+ return int(need_fix)
72
73
74
if __name__ == "__main__":
0 commit comments