Skip to content

Commit

Permalink
Fix flake8 E231: missing whitespace after ','
Browse files Browse the repository at this point in the history
Should be removed by Black, but currently buggy.

See: psf/black#1202
  • Loading branch information
callahad committed Feb 10, 2020
1 parent 3e40fb7 commit 7c3c784
Show file tree
Hide file tree
Showing 25 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion kuma/api/conftest.py
Expand Up @@ -38,7 +38,7 @@ def redirect_to_home(wiki_user):
Revision.objects.create(
document=doc,
creator=wiki_user,
content=REDIRECT_CONTENT % {"href": reverse("home"), "title": "MDN Web Docs",},
content=REDIRECT_CONTENT % {"href": reverse("home"), "title": "MDN Web Docs"},
title="Redirect to Home Page",
created=datetime(2015, 7, 4, 11, 15),
)
Expand Down
2 changes: 1 addition & 1 deletion kuma/attachments/models.py
Expand Up @@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
access_key=settings.ATTACHMENTS_AWS_ACCESS_KEY_ID,
secret_key=settings.ATTACHMENTS_AWS_SECRET_ACCESS_KEY,
bucket_name=settings.ATTACHMENTS_AWS_STORAGE_BUCKET_NAME,
object_parameters={"CacheControl": "public, max-age=31536000, immutable",},
object_parameters={"CacheControl": "public, max-age=31536000, immutable"},
default_acl="public-read",
querystring_auth=False,
custom_domain=settings.ATTACHMENTS_AWS_S3_CUSTOM_DOMAIN,
Expand Down
2 changes: 1 addition & 1 deletion kuma/attachments/utils.py
Expand Up @@ -36,7 +36,7 @@ def allow_add_attachment_by(user):
def full_attachment_url(attachment_id, filename):
path = reverse(
"attachments.raw_file",
kwargs={"attachment_id": attachment_id, "filename": filename,},
kwargs={"attachment_id": attachment_id, "filename": filename},
)
return f"{settings.PROTOCOL}{settings.ATTACHMENT_HOST}{path}"

Expand Down
2 changes: 1 addition & 1 deletion kuma/dashboards/tests/test_views.py
Expand Up @@ -789,7 +789,7 @@ def test_macros_no_counts(mock_usage, client, db):
"count": 0,
"en_count": 0,
},
"CSSRef": {"github_subpath": "CSSRef.ejs", "count": 0, "en_count": 0,},
"CSSRef": {"github_subpath": "CSSRef.ejs", "count": 0, "en_count": 0},
}

response = client.get(reverse("dashboards.macros"), HTTP_HOST=settings.WIKI_HOST)
Expand Down
2 changes: 1 addition & 1 deletion kuma/health/views.py
Expand Up @@ -178,7 +178,7 @@ def csp_violation_capture(request):

data = client.get_data_from_request(request)
data.update(
{"level": logging.INFO, "logger": "CSP",}
{"level": logging.INFO, "logger": "CSP"}
)
try:
csp_data = json.loads(request.body)
Expand Down
4 changes: 2 additions & 2 deletions kuma/payments/tests/test_utils.py
Expand Up @@ -10,7 +10,7 @@
# https://stripe.com/docs/api/customers/retrieve
simple_customer_data = {
"sources": {"data": [{"card": {"last4": "0019"}}]},
"subscriptions": {"data": [{"id": "sub_id", "plan": {"amount": 6400},}]},
"subscriptions": {"data": [{"id": "sub_id", "plan": {"amount": 6400}}]},
}


Expand All @@ -35,7 +35,7 @@ def test_cancel_stripe_customer_subscription(mock_sub, mock_cust):

@mock.patch(
"stripe.Customer.retrieve",
return_value={"subscriptions": {"data": [{"id": "sub_id1"}, {"id": "sub_id2"},]}},
return_value={"subscriptions": {"data": [{"id": "sub_id1"}, {"id": "sub_id2"}]}},
)
@mock.patch(
"stripe.Subscription.retrieve",
Expand Down
30 changes: 15 additions & 15 deletions kuma/scrape/fixture.py
Expand Up @@ -23,7 +23,7 @@ class FixtureLoader(object):
model_metadata = {
"account.emailaddress": {
"natural_key": ("email",),
"relations": {"user": {"link": "to_one", "resource": "users.user",},},
"relations": {"user": {"link": "to_one", "resource": "users.user"}},
},
"auth.group": {
"natural_key": ("name",),
Expand All @@ -40,45 +40,45 @@ class FixtureLoader(object):
},
},
},
"contenttypes.contenttype": {"natural_key": ("app_label", "model"),},
"database.constance": {"natural_key": ("key",),},
"contenttypes.contenttype": {"natural_key": ("app_label", "model")},
"database.constance": {"natural_key": ("key",)},
"feeder.bundle": {
"natural_key": ("shortname",),
"relations": {"feeds": {"link": "to_many", "resource": "feeder.feed",},},
"relations": {"feeds": {"link": "to_many", "resource": "feeder.feed"}},
},
"feeder.feed": {"natural_key": ("shortname",),},
"feeder.feed": {"natural_key": ("shortname",)},
"search.filter": {
"natural_key": ("name", "slug"),
"relations": {
"group": {"link": "to_one", "resource": "search.filtergroup"},
"tags": {"link": "to_many", "resource": "taggit.tag"},
},
},
"search.filtergroup": {"natural_key": ("name", "slug"),},
"sites.site": {"natural_key": ("id",),},
"search.filtergroup": {"natural_key": ("name", "slug")},
"sites.site": {"natural_key": ("id",)},
"socialaccount.socialaccount": {
"natural_key": ("uid", "provider"),
"relations": {"user": {"link": "to_one", "resource": "users.user",}},
"relations": {"user": {"link": "to_one", "resource": "users.user"}},
},
"socialaccount.socialapp": {
"natural_key": ("name",),
"relations": {"sites": {"link": "to_many", "resource": "sites.site"}},
},
"taggit.tag": {"natural_key": ("name",),},
"taggit.tag": {"natural_key": ("name",)},
"users.user": {
"natural_key": ("username",),
"relations": {"groups": {"link": "to_many", "resource": "auth.group",},},
"filters": {"password": "make_password",},
"relations": {"groups": {"link": "to_many", "resource": "auth.group"}},
"filters": {"password": "make_password"},
},
"users.userban": {
"natural_key": ("user", "by"),
"relations": {
"user": {"link": "to_one", "resource": "users.user",},
"by": {"link": "to_one", "resource": "users.user",},
"user": {"link": "to_one", "resource": "users.user"},
"by": {"link": "to_one", "resource": "users.user"},
},
},
"waffle.flag": {"natural_key": ("name",),},
"waffle.switch": {"natural_key": ("name",),},
"waffle.flag": {"natural_key": ("name",)},
"waffle.switch": {"natural_key": ("name",)},
}

class NeedsDependency(Exception):
Expand Down
10 changes: 5 additions & 5 deletions kuma/scrape/tests/test_fixture.py
Expand Up @@ -38,7 +38,7 @@ def test_load_group():
}
],
"contenttypes.contenttype": [
{"app_label": "attachments", "model": "attachment",}
{"app_label": "attachments", "model": "attachment"}
],
}
ct_attachment = ContentType.objects.get(app_label="attachments", model="attachment")
Expand All @@ -56,7 +56,7 @@ def test_load_group():

def test_underspecified_key_is_error():
"""A fixture must define all the natural key items."""
spec = {"users.user": [{"email": "email@example.com", "password": "password",}]}
spec = {"users.user": [{"email": "email@example.com", "password": "password"}]}
with pytest.raises(ValueError) as error:
FixtureLoader(spec)
assert str(error.value) == 'users.user 0: Needs key "username"'
Expand All @@ -68,7 +68,7 @@ def test_relation_as_key():
spec = {
"users.user": [
{"username": "admin", "is_staff": True},
{"username": "spammer",},
{"username": "spammer"},
],
"users.userban": [{"user": ["spammer"], "by": ["admin"], "reason": "Spam"}],
}
Expand All @@ -84,7 +84,7 @@ def test_update_m2m_of_existing_instance():
user = User.objects.create(username="ironman")
assert not user.groups.exists()
spec = {
"auth.group": [{"name": "Avengers",}, {"name": "Illuminati",}],
"auth.group": [{"name": "Avengers"}, {"name": "Illuminati"}],
"users.user": [
{
"username": "ironman",
Expand All @@ -111,7 +111,7 @@ def test_missing_relation_is_error():
def test_missing_key_relation_is_error():
"""An unspecified relation is detected, raises exception."""
spec = {
"users.user": [{"username": "odin",}],
"users.user": [{"username": "odin"}],
"users.userban": [{"user": ["loki"], "by": ["odin"], "reason": "Treason"}],
}
with pytest.raises(RuntimeError) as error:
Expand Down
2 changes: 1 addition & 1 deletion kuma/scrape/tests/test_source_document_meta.py
Expand Up @@ -12,7 +12,7 @@
"locale": "en-US",
"slug": "Learn/Getting_started_with_the_web",
"translations": [
{"locale": "fr", "url": "/fr/docs/Apprendre/Commencer_avec_le_web",},
{"locale": "fr", "url": "/fr/docs/Apprendre/Commencer_avec_le_web"},
{
"locale": "tr",
"url": "/tr/docs/%C3%96%C4%9Fren/Getting_started_with_the_web",
Expand Down
2 changes: 1 addition & 1 deletion kuma/search/apps.py
Expand Up @@ -17,7 +17,7 @@ def ready(self):

# Configure Elasticsearch connections for connection pooling.
es_connections.configure(
default={"hosts": settings.ES_URLS,},
default={"hosts": settings.ES_URLS},
indexing={
"hosts": settings.ES_URLS,
"timeout": settings.ES_INDEXING_TIMEOUT,
Expand Down
2 changes: 1 addition & 1 deletion kuma/search/tasks.py
Expand Up @@ -34,7 +34,7 @@ def prepare_index(index_pk):

# Disable automatic refreshing and replicas.
temporary_settings = {
"index": {"refresh_interval": "-1", "number_of_replicas": "0",}
"index": {"refresh_interval": "-1", "number_of_replicas": "0"}
}

es.indices.put_settings(temporary_settings, index=index.prefixed_name)
Expand Down
48 changes: 24 additions & 24 deletions kuma/settings/common.py
Expand Up @@ -78,7 +78,7 @@ def parse_conn_max_age(value):
"character_set_connection=utf8,"
"collation_connection=utf8_general_ci",
},
"TEST": {"CHARSET": "utf8", "COLLATION": "utf8_general_ci",},
"TEST": {"CHARSET": "utf8", "COLLATION": "utf8_general_ci"},
}
)

Expand Down Expand Up @@ -703,7 +703,7 @@ def pipeline_one_scss(slug, **kwargs):
"print": {
"source_filenames": ("styles/minimalist/print.scss",),
"output_filename": "build/styles/print.css",
"extra_context": {"media": "print",},
"extra_context": {"media": "print"},
},
"search": {
"source_filenames": ("styles/search.scss",),
Expand Down Expand Up @@ -887,12 +887,12 @@ def pipeline_one_scss(slug, **kwargs):
"react.js",
),
"output_filename": "build/js/react-main.js",
"extra_context": {"defer": True,},
"extra_context": {"defer": True},
},
"bcd-signal": {
"source_filenames": ("bcd-signal.js",),
"output_filename": "build/js/react-bcd-signal.js",
"extra_context": {"defer": True,},
"extra_context": {"defer": True},
},
"banners": {
"source_filenames": (
Expand All @@ -901,7 +901,7 @@ def pipeline_one_scss(slug, **kwargs):
"js/components/banners/banners.js",
),
"output_filename": "build/js/banners.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"users": {
"source_filenames": (
Expand All @@ -910,19 +910,19 @@ def pipeline_one_scss(slug, **kwargs):
"js/users.js",
),
"output_filename": "build/js/users.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"user-signup": {
"source_filenames": ("js/components/user-signup/signup.js",),
"output_filename": "build/js/signup.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"delete-user-page": {
"source_filenames": (
"js/components/account-management/delete-user-confirmation-button.js",
),
"output_filename": "build/js/delete-user-confirmation-button.js",
"extra_context": {"defer": True,},
"extra_context": {"defer": True},
},
"delete-user-modal": {
"source_filenames": (
Expand All @@ -931,20 +931,20 @@ def pipeline_one_scss(slug, **kwargs):
"js/components/account-management/delete-user-confirmation-button.js",
),
"output_filename": "build/js/delete-user-modal.js",
"extra_context": {"defer": True,},
"extra_context": {"defer": True},
},
"auth-modal": {
"source_filenames": (
"js/components/modal.js",
"js/components/user-signup/auth-modal.js",
),
"output_filename": "build/js/auth-modal.js",
"extra_context": {"defer": True,},
"extra_context": {"defer": True},
},
"dashboard": {
"source_filenames": ("js/dashboard.js",),
"output_filename": "build/js/dashboard.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"jquery-ui": {
"source_filenames": (
Expand All @@ -957,7 +957,7 @@ def pipeline_one_scss(slug, **kwargs):
"search": {
"source_filenames": ("js/search.js",),
"output_filename": "build/js/search.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"payments": {
"source_filenames": ("js/components/payments/payments-manage.js",),
Expand Down Expand Up @@ -1004,7 +1004,7 @@ def pipeline_one_scss(slug, **kwargs):
"js/components/page-load-actions.js",
),
"output_filename": "build/js/wiki.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"wiki-edit": {
"source_filenames": (
Expand All @@ -1018,7 +1018,7 @@ def pipeline_one_scss(slug, **kwargs):
"wiki-move": {
"source_filenames": ("js/wiki-move.js",),
"output_filename": "build/js/wiki-move.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"wiki-compat-tables": {
"source_filenames": ("js/wiki-compat-tables.js",),
Expand All @@ -1028,20 +1028,20 @@ def pipeline_one_scss(slug, **kwargs):
"task-completion": {
"source_filenames": ("js/task-completion.js",),
"output_filename": "build/js/task-completion.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"newsletter": {
"source_filenames": ("js/newsletter.js",),
"output_filename": "build/js/newsletter.js",
"extra_context": {"defer": True,},
"extra_context": {"defer": True},
},
"perf": {
"source_filenames": (
"js/utils/perf.js",
"js/utils/perf-post-message-handler.js",
),
"output_filename": "build/js/perf.js",
"extra_context": {"async": True,},
"extra_context": {"async": True},
},
"fetch-polyfill": {
"source_filenames": ("js/libs/unfetch-4.1.0.min.js",),
Expand Down Expand Up @@ -1320,7 +1320,7 @@ def parse_iframe_url(url):
"tidings.events",
)

CELERY_TASK_ANNOTATIONS = {"cacheback.tasks.refresh_cache": {"rate_limit": "120/m",}}
CELERY_TASK_ANNOTATIONS = {"cacheback.tasks.refresh_cache": {"rate_limit": "120/m"}}

CELERY_TASK_ROUTES = {
"cacheback.tasks.refresh_cache": {"queue": "mdn_purgeable"},
Expand Down Expand Up @@ -1565,7 +1565,7 @@ def parse_iframe_url(url):
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"filters": {"require_debug_true": {"()": "django.utils.log.RequireDebugTrue",}},
"filters": {"require_debug_true": {"()": "django.utils.log.RequireDebugTrue"}},
"formatters": {"simple": {"format": "%(name)s:%(levelname)s %(message)s"}},
"handlers": {
"console": {
Expand All @@ -1581,8 +1581,8 @@ def parse_iframe_url(url):
},
},
"loggers": {
"django": {"handlers": ["console"], "level": "INFO",}, # Drop mail_admins
"kuma": {"handlers": ["console-simple"], "propagate": True, "level": "ERROR",},
"django": {"handlers": ["console"], "level": "INFO"}, # Drop mail_admins
"kuma": {"handlers": ["console-simple"], "propagate": True, "level": "ERROR"},
"elasticsearch": {
"handlers": ["console-simple"],
"level": config("ES_LOG_LEVEL", default="ERROR"),
Expand All @@ -1592,8 +1592,8 @@ def parse_iframe_url(url):
"level": config("ES_TRACE_LOG_LEVEL", default="ERROR"),
"propagate": False,
},
"urllib3": {"handlers": ["console-simple"], "level": "ERROR",},
"cacheback": {"handlers": ["console-simple"], "level": "ERROR",},
"urllib3": {"handlers": ["console-simple"], "level": "ERROR"},
"cacheback": {"handlers": ["console-simple"], "level": "ERROR"},
},
}

Expand Down Expand Up @@ -1675,7 +1675,7 @@ def get_user_url(user):
RAVEN_CONFIG = {
"dsn": SENTRY_DSN,
"transport": RequestsHTTPTransport, # Sync transport
"ignore_exception": ["django.core.exceptions.DisallowedHost",],
"ignore_exception": ["django.core.exceptions.DisallowedHost"],
}
if REVISION_HASH and REVISION_HASH != "undefined":
RAVEN_CONFIG["release"] = REVISION_HASH
Expand Down

0 comments on commit 7c3c784

Please sign in to comment.