mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
Enable pycodestyle W605 (invalid escape sequence).
The only changes visible at the AST level, checked using https://github.com/asottile/astpretty, are zerver/lib/test_fixtures.py: '\x1b\\[(1|0)m' ↦ '\\x1b\\[(1|0)m' '\\[[X| ]\\] (\\d+_.+)\n' ↦ '\\[[X| ]\\] (\\d+_.+)\\n' which is fine because re treats '\\x1b' and '\\n' the same way as '\x1b' and '\n'. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
7b8d3023f5
commit
037f696d26
@@ -48,19 +48,19 @@ strip_whitespace_right = re.compile("(%s-?\\s*(trans|pluralize).*?-%s)\\s+" % (
|
||||
strip_whitespace_left = re.compile("\\s+(%s-\\s*(endtrans|pluralize).*?-?%s)" % (
|
||||
BLOCK_TAG_START, BLOCK_TAG_END), re.U)
|
||||
|
||||
regexes = ['{{#tr .*?}}([\s\S]*?){{/tr}}', # '.' doesn't match '\n' by default
|
||||
'{{\s*t "(.*?)"\W*}}',
|
||||
"{{\s*t '(.*?)'\W*}}",
|
||||
"i18n\.t\('([^\']*?)'\)",
|
||||
"i18n\.t\('(.*?)',\s*.*?[^,]\)",
|
||||
'i18n\.t\("([^\"]*?)"\)',
|
||||
'i18n\.t\("(.*?)",\s*.*?[^,]\)',
|
||||
regexes = [r'{{#tr .*?}}([\s\S]*?){{/tr}}', # '.' doesn't match '\n' by default
|
||||
r'{{\s*t "(.*?)"\W*}}',
|
||||
r"{{\s*t '(.*?)'\W*}}",
|
||||
r"i18n\.t\('([^']*?)'\)",
|
||||
r"i18n\.t\('(.*?)',\s*.*?[^,]\)",
|
||||
r'i18n\.t\("([^"]*?)"\)',
|
||||
r'i18n\.t\("(.*?)",\s*.*?[^,]\)',
|
||||
]
|
||||
tags = [('err_', "error"),
|
||||
]
|
||||
|
||||
frontend_compiled_regexes = [re.compile(regex) for regex in regexes]
|
||||
multiline_js_comment = re.compile("/\*.*?\*/", re.DOTALL)
|
||||
multiline_js_comment = re.compile(r"/\*.*?\*/", re.DOTALL)
|
||||
singleline_js_comment = re.compile("//.*?\n")
|
||||
|
||||
def strip_whitespaces(src: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user