Skip to content

Commit e864eab

Browse files
authored
style: Reformat with black==24.1.0 (#2680)
1 parent ed3ac88 commit e864eab

File tree

16 files changed

+73
-50
lines changed

16 files changed

+73
-50
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: end-of-file-fixer
99

1010
- repo: https://github.com/psf/black
11-
rev: 22.6.0
11+
rev: 24.1.0
1212
hooks:
1313
- id: black
1414
exclude: ^(.*_pb2.py|.*_pb2_grpc.py)

sentry_sdk/integrations/arq.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ def event_processor(event, hint):
149149
extra = event.setdefault("extra", {})
150150
extra["arq-job"] = {
151151
"task": ctx["job_name"],
152-
"args": args
153-
if _should_send_default_pii()
154-
else SENSITIVE_DATA_SUBSTITUTE,
155-
"kwargs": kwargs
156-
if _should_send_default_pii()
157-
else SENSITIVE_DATA_SUBSTITUTE,
152+
"args": (
153+
args if _should_send_default_pii() else SENSITIVE_DATA_SUBSTITUTE
154+
),
155+
"kwargs": (
156+
kwargs if _should_send_default_pii() else SENSITIVE_DATA_SUBSTITUTE
157+
),
158158
"retry": ctx["job_try"],
159159
}
160160

sentry_sdk/integrations/huey.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ def event_processor(event, hint):
7373
extra = event.setdefault("extra", {})
7474
extra["huey-job"] = {
7575
"task": task.name,
76-
"args": task.args
77-
if _should_send_default_pii()
78-
else SENSITIVE_DATA_SUBSTITUTE,
79-
"kwargs": task.kwargs
80-
if _should_send_default_pii()
81-
else SENSITIVE_DATA_SUBSTITUTE,
76+
"args": (
77+
task.args
78+
if _should_send_default_pii()
79+
else SENSITIVE_DATA_SUBSTITUTE
80+
),
81+
"kwargs": (
82+
task.kwargs
83+
if _should_send_default_pii()
84+
else SENSITIVE_DATA_SUBSTITUTE
85+
),
8286
"retry": (task.default_retries or 0) - task.retries,
8387
}
8488

sentry_sdk/integrations/opentelemetry/integration.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
are experimental and not suitable for production use. They may be changed or
44
removed at any time without prior notice.
55
"""
6+
67
import sys
78
from importlib import import_module
89

sentry_sdk/scope.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ def get_dynamic_sampling_context(self):
270270

271271
baggage = self.get_baggage()
272272
if baggage is not None:
273-
self._propagation_context[
274-
"dynamic_sampling_context"
275-
] = baggage.dynamic_sampling_context()
273+
self._propagation_context["dynamic_sampling_context"] = (
274+
baggage.dynamic_sampling_context()
275+
)
276276

277277
return self._propagation_context["dynamic_sampling_context"]
278278

sentry_sdk/serializer.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ def _serialize_node_impl(
348348
should_repr_strings=should_repr_strings,
349349
is_databag=is_databag,
350350
is_request_body=is_request_body,
351-
remaining_depth=remaining_depth - 1
352-
if remaining_depth is not None
353-
else None,
351+
remaining_depth=(
352+
remaining_depth - 1 if remaining_depth is not None else None
353+
),
354354
remaining_breadth=remaining_breadth,
355355
)
356356
rv_dict[str_k] = v
@@ -375,9 +375,9 @@ def _serialize_node_impl(
375375
should_repr_strings=should_repr_strings,
376376
is_databag=is_databag,
377377
is_request_body=is_request_body,
378-
remaining_depth=remaining_depth - 1
379-
if remaining_depth is not None
380-
else None,
378+
remaining_depth=(
379+
remaining_depth - 1 if remaining_depth is not None else None
380+
),
381381
remaining_breadth=remaining_breadth,
382382
)
383383
)

sentry_sdk/tracing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ def get_trace_context(self):
544544
rv["status"] = self.status
545545

546546
if self.containing_transaction:
547-
rv[
548-
"dynamic_sampling_context"
549-
] = self.containing_transaction.get_baggage().dynamic_sampling_context()
547+
rv["dynamic_sampling_context"] = (
548+
self.containing_transaction.get_baggage().dynamic_sampling_context()
549+
)
550550

551551
return rv
552552

tests/integrations/asyncpg/test_asyncpg.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
The tests use the following credentials to establish a database connection.
1010
"""
11+
1112
import os
1213

1314

tests/integrations/aws_lambda/client.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,14 @@ def repl(runtime, verbose):
386386
_REPL_CODE.format(line=line),
387387
b"",
388388
cleanup.append,
389-
subprocess_kwargs={
390-
"stdout": subprocess.DEVNULL,
391-
"stderr": subprocess.DEVNULL,
392-
}
393-
if not verbose
394-
else {},
389+
subprocess_kwargs=(
390+
{
391+
"stdout": subprocess.DEVNULL,
392+
"stderr": subprocess.DEVNULL,
393+
}
394+
if not verbose
395+
else {}
396+
),
395397
)
396398

397399
for line in base64.b64decode(response["LogResult"]).splitlines():

tests/integrations/clickhouse_driver/test_clickhouse_driver.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
docker run -d -p 18123:8123 -p9000:9000 --name clickhouse-test --ulimit nofile=262144:262144 --rm clickhouse/clickhouse-server
55
```
66
"""
7+
78
import clickhouse_driver
89
from clickhouse_driver import Client, connect
910

tests/integrations/django/myapp/custom_urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16+
1617
from __future__ import absolute_import
1718

1819
try:

tests/integrations/django/myapp/settings.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
https://docs.djangoproject.com/en/2.0/ref/settings/
1111
"""
1212

13-
1413
# We shouldn't access settings while setting up integrations. Initialize SDK
1514
# here to provoke any errors that might occur.
1615
import sentry_sdk

tests/integrations/django/myapp/urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16+
1617
from __future__ import absolute_import
1718

1819
try:

tests/integrations/gcp/test_gcp.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# GCP Cloud Functions unit tests
33
44
"""
5+
56
import json
67
from textwrap import dedent
78
import tempfile

tests/integrations/starlette/test_starlette.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,11 @@ def test_middleware_partial_receive_send(sentry_init, capture_events):
779779
},
780780
{
781781
"op": "middleware.starlette.receive",
782-
"description": "_ASGIAdapter.send.<locals>.receive"
783-
if STARLETTE_VERSION < (0, 21)
784-
else "_TestClientTransport.handle_request.<locals>.receive",
782+
"description": (
783+
"_ASGIAdapter.send.<locals>.receive"
784+
if STARLETTE_VERSION < (0, 21)
785+
else "_TestClientTransport.handle_request.<locals>.receive"
786+
),
785787
"tags": {"starlette.middleware_name": "ServerErrorMiddleware"},
786788
},
787789
{

tests/test_profiler.py

+25-15
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,11 @@ def static_method():
393393
),
394394
pytest.param(
395395
GetFrame().instance_method_wrapped()(),
396-
"wrapped"
397-
if sys.version_info < (3, 11)
398-
else "GetFrame.instance_method_wrapped.<locals>.wrapped",
396+
(
397+
"wrapped"
398+
if sys.version_info < (3, 11)
399+
else "GetFrame.instance_method_wrapped.<locals>.wrapped"
400+
),
399401
id="instance_method_wrapped",
400402
),
401403
pytest.param(
@@ -405,9 +407,11 @@ def static_method():
405407
),
406408
pytest.param(
407409
GetFrame().class_method_wrapped()(),
408-
"wrapped"
409-
if sys.version_info < (3, 11)
410-
else "GetFrame.class_method_wrapped.<locals>.wrapped",
410+
(
411+
"wrapped"
412+
if sys.version_info < (3, 11)
413+
else "GetFrame.class_method_wrapped.<locals>.wrapped"
414+
),
411415
id="class_method_wrapped",
412416
),
413417
pytest.param(
@@ -422,9 +426,11 @@ def static_method():
422426
),
423427
pytest.param(
424428
GetFrame().inherited_instance_method_wrapped()(),
425-
"wrapped"
426-
if sys.version_info < (3, 11)
427-
else "GetFrameBase.inherited_instance_method_wrapped.<locals>.wrapped",
429+
(
430+
"wrapped"
431+
if sys.version_info < (3, 11)
432+
else "GetFrameBase.inherited_instance_method_wrapped.<locals>.wrapped"
433+
),
428434
id="instance_method_wrapped",
429435
),
430436
pytest.param(
@@ -434,16 +440,20 @@ def static_method():
434440
),
435441
pytest.param(
436442
GetFrame().inherited_class_method_wrapped()(),
437-
"wrapped"
438-
if sys.version_info < (3, 11)
439-
else "GetFrameBase.inherited_class_method_wrapped.<locals>.wrapped",
443+
(
444+
"wrapped"
445+
if sys.version_info < (3, 11)
446+
else "GetFrameBase.inherited_class_method_wrapped.<locals>.wrapped"
447+
),
440448
id="inherited_class_method_wrapped",
441449
),
442450
pytest.param(
443451
GetFrame().inherited_static_method(),
444-
"inherited_static_method"
445-
if sys.version_info < (3, 11)
446-
else "GetFrameBase.inherited_static_method",
452+
(
453+
"inherited_static_method"
454+
if sys.version_info < (3, 11)
455+
else "GetFrameBase.inherited_static_method"
456+
),
447457
id="inherited_static_method",
448458
),
449459
],

0 commit comments

Comments
 (0)