pep8: Fix E231.

This commit is contained in:
Bickio 2016-12-01 09:55:59 +13:00 committed by Tim Abbott
parent 3c0ea4da6f
commit e009383460
11 changed files with 14 additions and 14 deletions

View File

@ -85,7 +85,7 @@ def check_pep8(files):
'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226', 'E124', 'E125', 'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226', 'E124', 'E125',
'E126', 'E127', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303', 'E126', 'E127', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303',
'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E111', 'E731', 'E302', 'E129', 'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E111', 'E731', 'E302', 'E129',
'E741', 'E714', 'W391', 'E211', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306', 'E231', 'E741', 'E714', 'W391', 'E211', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306',
] ]
pep8 = subprocess.Popen( pep8 = subprocess.Popen(
['pycodestyle'] + files + ['--ignore={rules}'.format(rules=','.join(ignored_rules))], ['pycodestyle'] + files + ['--ignore={rules}'.format(rules=','.join(ignored_rules))],
@ -339,7 +339,7 @@ def build_custom_checkers(by_lang):
{'pattern': '^[ ][ ][a-zA-Z0-9]', {'pattern': '^[ ][ ][a-zA-Z0-9]',
'description': "Incorrect 2-space indentation in CSS", 'description': "Incorrect 2-space indentation in CSS",
'exclude': set(['static/styles/thirdparty-fonts.css']), 'exclude': set(['static/styles/thirdparty-fonts.css']),
'strip': '\n',}, 'strip': '\n'},
{'pattern': '{\w', {'pattern': '{\w',
'description': "Missing whitespace after '{' in CSS (should be newline)."}, 'description': "Missing whitespace after '{' in CSS (should be newline)."},
]) + whitespace_rules # type: RuleList ]) + whitespace_rules # type: RuleList

View File

@ -104,7 +104,7 @@ class HomepageForm(forms.Form):
# This form is important because it determines whether users can # This form is important because it determines whether users can
# register for our product. Be careful when modifying the # register for our product. Be careful when modifying the
# validators. # validators.
email = forms.EmailField(validators=[is_inactive,]) email = forms.EmailField(validators=[is_inactive])
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
# type: (*Any, **Any) -> None # type: (*Any, **Any) -> None

View File

@ -96,7 +96,7 @@ def get_display_recipient_remote_cache(recipient_id, recipient_type, recipient_t
'full_name': user_profile.full_name, 'full_name': user_profile.full_name,
'short_name': user_profile.short_name, 'short_name': user_profile.short_name,
'id': user_profile.id, 'id': user_profile.id,
'is_mirror_dummy': user_profile.is_mirror_dummy,} for user_profile in user_profile_list] 'is_mirror_dummy': user_profile.is_mirror_dummy} for user_profile in user_profile_list]
def get_realm_emoji_cache_key(realm): def get_realm_emoji_cache_key(realm):
# type: (Realm) -> Text # type: (Realm) -> Text

View File

@ -964,7 +964,7 @@ class EventQueueTest(TestCase):
queue.push({"type": "restart", "server_generation": "2"}) queue.push({"type": "restart", "server_generation": "2"})
self.assertEqual(queue.contents(), self.assertEqual(queue.contents(),
[{"type": "unknown", [{"type": "unknown",
"id": 9,}, "id": 9},
{'id': 19, {'id': 19,
'type': 'pointer', 'type': 'pointer',
"pointer": 19, "pointer": 19,
@ -978,7 +978,7 @@ class EventQueueTest(TestCase):
"timestamp": str(pointer_val)}) "timestamp": str(pointer_val)})
self.assertEqual(queue.contents(), self.assertEqual(queue.contents(),
[{"type": "unknown", [{"type": "unknown",
"id": 9,}, "id": 9},
{'id': 19, {'id': 19,
'type': 'pointer', 'type': 'pointer',
"pointer": 19, "pointer": 19,

View File

@ -484,7 +484,7 @@ class StreamMessagesTest(ZulipTestCase):
"client": "test suite", "client": "test suite",
"subject": "announcement", "subject": "announcement",
"content": "Everyone knows Iago rules", "content": "Everyone knows Iago rules",
"forged": "true",}, "forged": "true"},
**self.api_auth(email)) **self.api_auth(email))
self.assert_json_error(result, "User not authorized for this query") self.assert_json_error(result, "User not authorized for this query")

View File

@ -78,7 +78,7 @@ class PublicURLTest(ZulipTestCase):
"/json/messages", "/json/messages",
"/api/v1/streams", "/api/v1/streams",
], ],
404: ["/help/nonexistent",], 404: ["/help/nonexistent"],
} }
post_urls = {200: ["/accounts/login/"], post_urls = {200: ["/accounts/login/"],
302: ["/accounts/logout/"], 302: ["/accounts/logout/"],

View File

@ -298,7 +298,7 @@ def get_members_backend(request, user_profile):
"is_active": profile.is_active, "is_active": profile.is_active,
"is_admin": (profile in admins), "is_admin": (profile in admins),
"email": profile.email, "email": profile.email,
"avatar_url": avatar_url,} "avatar_url": avatar_url}
if profile.is_bot and profile.bot_owner is not None: if profile.is_bot and profile.bot_owner is not None:
member["bot_owner"] = profile.bot_owner.email member["bot_owner"] = profile.bot_owner.email
members.append(member) members.append(member)

View File

@ -142,7 +142,7 @@ def api_jira_webhook(request, user_profile, client,
else: else:
assignee_blurb = '' assignee_blurb = ''
content = "%s **updated** %s%s:\n\n" % (author, issue, assignee_blurb) content = "%s **updated** %s%s:\n\n" % (author, issue, assignee_blurb)
changelog = get_in(payload, ['changelog',]) changelog = get_in(payload, ['changelog'])
comment = get_in(payload, ['comment', 'body']) comment = get_in(payload, ['comment', 'body'])
if changelog != '': if changelog != '':