public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4842] Fix flake8 errors.
@ 2021-11-02  9:27 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-11-02  9:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:28d8167d2163316546febb528298cf9c26b6c761

commit r12-4842-g28d8167d2163316546febb528298cf9c26b6c761
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 2 10:27:27 2021 +0100

    Fix flake8 errors.
    
    contrib/ChangeLog:
    
            * check-internal-format-escaping.py: Fix flake8 errors.

Diff:
---
 contrib/check-internal-format-escaping.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/check-internal-format-escaping.py b/contrib/check-internal-format-escaping.py
index e06752666b8..8bd54d88c74 100755
--- a/contrib/check-internal-format-escaping.py
+++ b/contrib/check-internal-format-escaping.py
@@ -66,7 +66,7 @@ def lint_gcc_internal_format(msg: polib.POEntry):
 
     def outside_quotes(m: Match[str]):
         before = msgid[:m.start(0)]
-        return before.count("%<") == before.count("%>")
+        return before.count('%<') == before.count('%>')
 
     def lint_matching_placeholders():
         """
@@ -127,7 +127,7 @@ def lint_gcc_internal_format(msg: polib.POEntry):
         to separate the words.
         """
 
-        for match in re.finditer("(.?[a-zA-Z0-9])%<", msgid):
+        for match in re.finditer('(.?[a-zA-Z0-9])%<', msgid):
             if match.group(1) != '%s':
                 warn(msg,
                      'no-space-before-quote',
@@ -143,7 +143,7 @@ def lint_gcc_internal_format(msg: polib.POEntry):
         * static_cast and the like (which are legitimate)
         """
 
-        for match in re.finditer("_", msgid):
+        for match in re.finditer('_', msgid):
             if outside_quotes(match):
                 warn(msg,
                      'underscore-outside-quotes',
@@ -163,13 +163,13 @@ def lint_gcc_internal_format(msg: polib.POEntry):
                  'the term "may not" is ambiguous')
 
     def lint_unbalanced_quotes():
-        if msgid.count("%<") != msgid.count("%>"):
+        if msgid.count('%<') != msgid.count('%>'):
             warn(msg,
                  'unbalanced-quotes',
                  'unbalanced %< and %> quotes')
 
         if msg.translated():
-            if msg.msgstr.count("%<") != msg.msgstr.count("%>"):
+            if msg.msgstr.count('%<') != msg.msgstr.count('%>'):
                 warn(msg,
                      'unbalanced-quotes',
                      'unbalanced %< and %> quotes')


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-02  9:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02  9:27 [gcc r12-4842] Fix flake8 errors Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).