From e15665bbda958f2ff31994b5b5108152e1935365 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 27 Jul 2019 23:39:53 -0700 Subject: [PATCH] Docstring may also be prefixed with f, U, R, and F. --- pycodestyle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pycodestyle.py b/pycodestyle.py index 4ade0871..ec65a845 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -133,7 +133,9 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation. RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,') RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$') ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') -DOCSTRING_REGEX = re.compile(r'u?r?["\']') +DOCSTRING_REGEX = re.compile('(u|r|ur|ru' + + ('|fr|rf' if sys.version_info >= (3, 6) else '') + + r')?["\']', re.IGNORECASE) EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[\[({] | [\]}),;:]') WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') COMPARE_SINGLETON_REGEX = re.compile(r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)'