Skip to content

Commit

Permalink
Fix Printf checker
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize committed Nov 8, 2021
1 parent 101f203 commit c60d26f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/poboy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,16 +1086,15 @@ def message_classify(self, catalog, message):
if msgid[-1] == " " or msgstr[-1] == " ":
classes.append(catalog.warning_end_space)

if message.python_format:
p0 = list(PRINTF_RE.findall(msgid))
p1 = list(PRINTF_RE.findall(msgstr))
if len(p0) == len(p0):
for a, b in zip(p0,p1):
if a != b:
classes.append(catalog.error_printf)
break
else:
classes.append(catalog.error_printf)
p0 = list(PRINTF_RE.findall(msgid))
p1 = list(PRINTF_RE.findall(msgstr))
if len(p0) == len(p1):
for a, b in zip(p0,p1):
if a != b:
classes.append(catalog.error_printf)
break
else:
classes.append(catalog.error_printf)

if msgid[0].isupper() != msgstr[0].isupper():
classes.append(catalog.warning_start_capital)
Expand Down

0 comments on commit c60d26f

Please sign in to comment.