Skip to content

Commit 09ab59d

Browse files
Merge pull request #3821 from open-formulieren/chore/update-black
Update black to `24.1.1`
2 parents 77e7113 + a714be8 commit 09ab59d

File tree

106 files changed

+205
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+205
-107
lines changed

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ a39b15a21d28ee995e861cad489f0648fc971f7e
66
f185fedaa603a1ef0285dd30e47f74218677c2c6
77
232688b1cb23d3590a8dccc640e1fffe6d4328c5
88

9+
# Black
10+
dbe92ee0499968064d47ae33d178c1d40738bd66

requirements/ci.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ billiard==3.6.4.0
4949
# -c requirements/base.txt
5050
# -r requirements/base.txt
5151
# celery
52-
black==22.12.0
52+
black==24.1.1
5353
# via -r requirements/test-tools.in
5454
bleach[css]==5.0.1
5555
# via
@@ -622,6 +622,7 @@ packaging==23.1
622622
# via
623623
# -c requirements/base.txt
624624
# -r requirements/base.txt
625+
# black
625626
# prance
626627
# pytest
627628
# sphinx
@@ -952,6 +953,7 @@ typing-extensions==4.9.0
952953
# via
953954
# -c requirements/base.txt
954955
# -r requirements/base.txt
956+
# black
955957
# pyee
956958
tzdata==2023.3
957959
# via

requirements/dev.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ billiard==3.6.4.0
5757
# -c requirements/ci.txt
5858
# -r requirements/ci.txt
5959
# celery
60-
black==22.12.0
60+
black==24.1.1
6161
# via
6262
# -c requirements/ci.txt
6363
# -r requirements/ci.txt
@@ -713,6 +713,7 @@ packaging==23.1
713713
# via
714714
# -c requirements/ci.txt
715715
# -r requirements/ci.txt
716+
# black
716717
# build
717718
# prance
718719
# pytest
@@ -1136,6 +1137,7 @@ typing-extensions==4.9.0
11361137
# via
11371138
# -c requirements/ci.txt
11381139
# -r requirements/ci.txt
1140+
# black
11391141
# pyee
11401142
tzdata==2023.3
11411143
# via

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore=E203,E261,E501,E731,F405,W293,W291,W503
2+
ignore=E203,E261,E501,E704,E731,F405,W293,W291,W503
33
max-line-length=88
44
exclude=
55
migrations

src/csp_post_processor/drf/fields.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Django Rest Framework integration to apply post processing for serializer fields.
33
"""
4+
45
import logging
56

67
from rest_framework import fields

src/csp_post_processor/drf/spectacular.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
API schema generation extension using drf-spectacular.
33
"""
4+
45
import logging
56

67
from django.utils.translation import gettext_lazy as _

src/csp_post_processor/fields.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Django model field integration to wrap WYSIWYG library fields.
33
"""
4+
45
from django.db.models import TextField
56

67

src/openforms/accounts/tests/test_hijacking.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Assert that the hijack funtionality works even with 2FA.
33
"""
4+
45
from django.contrib.auth import SESSION_KEY
56
from django.test import override_settings
67
from django.urls import reverse

src/openforms/accounts/tests/test_user_preferences.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for managing the (admin) user preferences.
33
"""
4+
45
from django.urls import reverse, reverse_lazy
56

67
from django_webtest import WebTest

src/openforms/api/drf_jsonschema.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
drf_jsonschema integration - register custom converters
33
"""
4+
45
from typing import Any
56

67
from django.utils.translation import gettext_lazy as _

src/openforms/api/exception_handling.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ def get_validation_errors(validation_errors: dict | list, camelize=True):
7676
# ('type', 'about:blank'),
7777
(
7878
"name",
79-
underscore_to_camel(field_name)
80-
if camelize
81-
else field_name,
79+
(
80+
underscore_to_camel(field_name)
81+
if camelize
82+
else field_name
83+
),
8284
),
8385
("code", err.code),
8486
("reason", str(err)),
@@ -91,9 +93,11 @@ def get_validation_errors(validation_errors: dict | list, camelize=True):
9193
# ('type', 'about:blank'),
9294
(
9395
"name",
94-
underscore_to_camel(field_name)
95-
if camelize
96-
else field_name,
96+
(
97+
underscore_to_camel(field_name)
98+
if camelize
99+
else field_name
100+
),
97101
),
98102
("code", error.code),
99103
("reason", str(error)),

src/openforms/api/views/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Concrete view classes/utilities not tied to any particular app.
33
"""
4+
45
import logging
56
import os
67
from collections import OrderedDict

src/openforms/appointments/contrib/demo/tests/test_endpoints.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test that the demo plugin can be used to simulate endpoint responses.
33
"""
4+
45
from datetime import date
56
from unittest.mock import patch
67

src/openforms/appointments/contrib/qmatic/tests/test_appointment_create.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
VCR tests for creating an appointment with Qmatic.
33
"""
4+
45
import json
56
from datetime import date
67

src/openforms/appointments/contrib/qmatic/tests/test_dates_list.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for retrieving available appointment dates from Qmatic through our own API.
33
"""
4+
45
from datetime import date
56

67
from django.test import TestCase

src/openforms/appointments/contrib/qmatic/tests/test_products_list.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for retrieving available products from Qmatic through our own API.
33
"""
4+
45
from django.test import TestCase
56

67
from openforms.utils.tests.vcr import OFVCRMixin

src/openforms/appointments/contrib/qmatic/tests/test_times_list.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for retrieving available appointment times from Qmatic through our own API.
33
"""
4+
45
from datetime import date
56

67
from django.test import TestCase

src/openforms/appointments/core.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
This module is the follow-up to the bulk of functionality in utils.py, which is doing
55
way too much but can't be easily refactored without breaking existing functionality.
66
"""
7+
78
import logging
89

910
from django.utils.translation import gettext_lazy as _

src/openforms/appointments/service.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
The exported names here may be used in other django apps and/or Open Forms modules.
55
Anything else is considered private API.
66
"""
7+
78
from openforms.submissions.models import Submission
89

910
from .renderer import AppointmentRenderer

src/openforms/appointments/tests/test_confirmation_emails.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test the generic confirmation e-mail sending for appointment forms.
33
"""
4+
45
from datetime import date, datetime, time
56
from unittest.mock import patch
67

src/openforms/authentication/contrib/digid/views.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def get(self, request):
101101
request.session[DIGID_AUTH_SESSION_KEY] = bsn
102102
# store the authn contexts so the plugin can check persmission when
103103
# accessing/creating an object
104-
request.session[
105-
DIGID_AUTH_SESSION_AUTHN_CONTEXTS
106-
] = response.get_authn_contexts()
104+
request.session[DIGID_AUTH_SESSION_AUTHN_CONTEXTS] = (
105+
response.get_authn_contexts()
106+
)
107107

108108
return HttpResponseRedirect(self.get_success_url())

src/openforms/authentication/contrib/eherkenning/views.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def get(self, request):
147147

148148
# store the authn contexts so the plugin can check persmission when
149149
# accessing/creating an object
150-
request.session[
151-
EHERKENNING_AUTH_SESSION_AUTHN_CONTEXTS
152-
] = response.get_authn_contexts()
150+
request.session[EHERKENNING_AUTH_SESSION_AUTHN_CONTEXTS] = (
151+
response.get_authn_contexts()
152+
)
153153

154154
return HttpResponseRedirect(self.get_success_url())

src/openforms/conf/base.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,11 @@
465465
"level": "DEBUG",
466466
},
467467
"log_outgoing_requests": {
468-
"handlers": ["log_outgoing_requests", "save_outgoing_requests"]
469-
if LOG_REQUESTS
470-
else [],
468+
"handlers": (
469+
["log_outgoing_requests", "save_outgoing_requests"]
470+
if LOG_REQUESTS
471+
else []
472+
),
471473
"level": "DEBUG",
472474
"propagate": True,
473475
},

src/openforms/conf/production.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Tweaks the base settings so that caching mechanisms are used where possible,
44
and HTTPS is leveraged where possible to further secure things.
55
"""
6+
67
import os
78

89
os.environ.setdefault("ENVIRONMENT", "production")

src/openforms/conf/staging.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Staging environment settings module.
33
This *should* be nearly identical to production.
44
"""
5+
56
import os
67

78
os.environ.setdefault("ENVIRONMENT", "staging")

src/openforms/config/views.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ def _subset_match(requested: str | None, checking: str) -> bool:
3131
class ConfigCheckable(Protocol):
3232
verbose_name: str
3333

34-
def check_config(self) -> None:
35-
...
34+
def check_config(self) -> None: ...
3635

37-
def get_config_actions(self) -> list[Action]:
38-
...
36+
def get_config_actions(self) -> list[Action]: ...
3937

4038

4139
def is_plugin(plugin: Any) -> TypeGuard[AbstractBasePlugin]:

src/openforms/contrib/brk/validators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __call__(self, value: AddressValue, submission: Submission) -> bool:
104104
if "house_number_addition" in value:
105105
address_query["huisnummertoevoeging"] = value["house_number_addition"]
106106

107-
with (client, suppress_api_errors(self.error_messages["retrieving_error"])):
107+
with client, suppress_api_errors(self.error_messages["retrieving_error"]):
108108
real_estate_objects_resp = client.get_real_estate_by_address(address_query)
109109
real_estate_objects = glom(
110110
real_estate_objects_resp,

src/openforms/contrib/haal_centraal/clients/brp.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Documentation for v2: https://brp-api.github.io/Haal-Centraal-BRP-bevragen/v2/getting-started
77
"""
8+
89
import logging
910
from abc import ABC, abstractmethod
1011
from collections.abc import Sequence
@@ -57,8 +58,7 @@ def __init__(
5758
self.headers["x-gebruiker"] = gebruiker
5859

5960
@abstractmethod
60-
def find_person(self, bsn: str, **kwargs) -> JSONObject | None:
61-
...
61+
def find_person(self, bsn: str, **kwargs) -> JSONObject | None: ...
6262

6363
@abstractmethod
6464
def get_family_members(
@@ -70,8 +70,7 @@ def get_family_members(
7070
...
7171

7272
@abstractmethod
73-
def make_config_test_request(self) -> None:
74-
...
73+
def make_config_test_request(self) -> None: ...
7574

7675

7776
class V1Client(HALMixin, BRPClient):

src/openforms/contrib/haal_centraal/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Configuration for Haal Centraal APIs
33
"""
4+
45
from django.db import models
56
from django.utils.translation import gettext_lazy as _
67

src/openforms/contrib/microsoft/client.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
requirements such as mTLS are not relevant. The service model definition also does not
88
allow configuring any of those aspects.
99
"""
10+
1011
import json
1112
import os
1213
from io import BytesIO

src/openforms/dmn/contrib/camunda/tests/test_plugin.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
You can also point to a different host/URL and/or credentials through environment
1414
variables, see :mod:`openforms.contrib.camunda.tests.utils`.
1515
"""
16+
1617
import logging
1718
from functools import partial
1819
from unittest.mock import patch

src/openforms/dmn/service.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Public Python API for the DMN module.
33
"""
4+
45
from typing import Any
56

67
from .base import BasePlugin

src/openforms/emails/api/serializers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def to_internal_value(self, data):
2727
if not (translated_content := translations.get("content")):
2828
continue
2929

30-
data["translations"][language_code][
31-
"content"
32-
] = self._add_cosign_templatetag(translated_content)
30+
data["translations"][language_code]["content"] = (
31+
self._add_cosign_templatetag(translated_content)
32+
)
3333

3434
return super().to_internal_value(data)
3535

src/openforms/emails/templatetags/appointments.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def appointment_information(context):
3737
as_html=not as_text,
3838
),
3939
"appointment_cancel_link": plugin.get_cancel_link(context["_submission"]),
40-
"appointment_change_link": plugin.get_change_link(context["_submission"])
41-
if not appointment
42-
else "",
40+
"appointment_change_link": (
41+
plugin.get_change_link(context["_submission"]) if not appointment else ""
42+
),
4343
}
4444
return render_to_string(template_name, tag_context)

src/openforms/formio/api/schema.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Define some (basic) OpenAPI schema for Form.io components.
33
"""
4+
45
from django.utils.translation import gettext_lazy as _
56

67
from drf_spectacular.plumbing import build_basic_type, build_object_type

src/openforms/formio/components/custom.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ def __call__(
111111
include_children: bool,
112112
include_partner: bool,
113113
submission: Submission | None = ...,
114-
) -> list[tuple[str, str]]:
115-
...
114+
) -> list[tuple[str, str]]: ...
116115

117116

118117
@register("npFamilyMembers")

0 commit comments

Comments
 (0)