Patchwork D6997: contrib: fix check-code to be able to detect missing _() with bytestrings

login
register
mail settings
Submitter phabricator
Date Oct. 6, 2019, 3:01 p.m.
Message ID <differential-rev-PHID-DREV-up7qn3u5ikzgsdyx4hwi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42015/
State Superseded
Headers show

Comments

phabricator - Oct. 6, 2019, 3:01 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6997

AFFECTED FILES
  contrib/check-code.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -508,7 +508,7 @@ 
          [ \t\n#]*
          (?# any strings/comments might precede a string, which
            # contains translatable message)
-         ((['"]|\'\'\'|""")[ \npq%bAPMxno]*(['"]|\'\'\'|""")[ \t\n#]+)*
+         b?((['"]|\'\'\'|""")[ \npq%bAPMxno]*(['"]|\'\'\'|""")[ \t\n#]+)*
          (?# sequence consisting of below might precede translatable message
            # - formatting string: "% 10s", "%05d", "% -3.2f", "%*s", "%%" ...
            # - escaped character: "\\", "\n", "\0" ...