python: Pre-fix a few spots for better Black formatting.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-09-01 17:50:08 -07:00
committed by Tim Abbott
parent c67ea05423
commit f91d287447
33 changed files with 123 additions and 97 deletions

View File

@@ -28,7 +28,7 @@ EXCLUDED_URLS = [
'https://www.udemy.com/course/the-complete-react-native-and-redux-course/',
]
VNU_IGNORE = re.compile(r'|'.join([
VNU_IGNORE = [
# Real errors that should be fixed.
r'Duplicate ID “[^”]*”\.',
r'The first occurrence of ID “[^”]*” was here\.',
@@ -39,7 +39,8 @@ VNU_IGNORE = re.compile(r'|'.join([
# Warnings that are probably less important.
r'The “type” attribute is unnecessary for JavaScript resources\.',
]))
]
VNU_IGNORE_REGEX = re.compile(r'|'.join(VNU_IGNORE))
class BaseDocumentationSpider(scrapy.Spider):
@@ -91,7 +92,7 @@ class BaseDocumentationSpider(scrapy.Spider):
def callback(response: Response) -> None:
vnu_out = json.loads(response.text)
for message in vnu_out['messages']:
if not VNU_IGNORE.fullmatch(message['message']):
if not VNU_IGNORE_REGEX.fullmatch(message['message']):
self.logger.error(
'"%s":%d.%d-%d.%d: %s: %s',
url,