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',
'E126', 'E127', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303',
'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(
['pycodestyle'] + files + ['--ignore={rules}'.format(rules=','.join(ignored_rules))],
@ -339,7 +339,7 @@ def build_custom_checkers(by_lang):
{'pattern': '^[ ][ ][a-zA-Z0-9]',
'description': "Incorrect 2-space indentation in CSS",
'exclude': set(['static/styles/thirdparty-fonts.css']),
'strip': '\n',},
'strip': '\n'},
{'pattern': '{\w',
'description': "Missing whitespace after '{' in CSS (should be newline)."},
]) + whitespace_rules # type: RuleList

View File

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

View File

@ -2254,7 +2254,7 @@ def do_change_left_side_userlist(user_profile, setting_value, log=True):
user_profile.save(update_fields=["left_side_userlist"])
event = {'type': 'update_display_settings',
'user': user_profile.email,
'setting_name':'left_side_userlist',
'setting_name': 'left_side_userlist',
'setting': setting_value}
if log:
log_event(event)
@ -2273,7 +2273,7 @@ def do_change_default_language(user_profile, setting_value, log=True):
user_profile.save(update_fields=["default_language"])
event = {'type': 'update_display_settings',
'user': user_profile.email,
'setting_name':'default_language',
'setting_name': 'default_language',
'setting': setting_value}
if log:
log_event(event)

View File

@ -15,7 +15,7 @@ def get_realm_expired_messages(realm):
pub_date__lt=expired_date)
if not expired_messages.exists():
return None
return {'realm_id': realm.id,'expired_messages': expired_messages}
return {'realm_id': realm.id, 'expired_messages': expired_messages}
def get_expired_messages():

View File

@ -96,7 +96,7 @@ def get_display_recipient_remote_cache(recipient_id, recipient_type, recipient_t
'full_name': user_profile.full_name,
'short_name': user_profile.short_name,
'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):
# type: (Realm) -> Text

View File

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

View File

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

View File

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

View File

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

View File

@ -142,7 +142,7 @@ def api_jira_webhook(request, user_profile, client,
else:
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'])
if changelog != '':

View File

@ -215,7 +215,7 @@ v1_api_and_json_patterns = [
# users/me -> zerver.views
url(r'^users/me$', rest_dispatch,
{'GET': 'zerver.views.pointer.get_profile_backend',
'DELETE':'zerver.views.users.deactivate_user_own_backend'}),
'DELETE': 'zerver.views.users.deactivate_user_own_backend'}),
url(r'^users/me/pointer$', rest_dispatch,
{'GET': 'zerver.views.pointer.get_pointer_backend',
'PUT': 'zerver.views.pointer.update_pointer_backend'}),