Skip to content

Commit 4957176

Browse files
authored
fixing black formatting now that COM812 is disabled (ScreenPyHQ#159)
1 parent 4eea9c3 commit 4957176

18 files changed

Lines changed: 71 additions & 178 deletions

screenpy/actions/eventually.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ class _TimeframeBuilder:
5252
"""Build a timeframe, combining numbers and units."""
5353

5454
def __init__(
55-
self,
56-
eventually: Eventually,
57-
amount: float,
58-
attribute: str,
55+
self, eventually: Eventually, amount: float, attribute: str
5956
) -> None:
6057
self.eventually = eventually
6158
self.amount = amount

screenpy/actions/stop.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def until_the(cls, question: Answerable, resolution: Resolvable) -> Self:
5050
return cls(question, resolution)
5151

5252
def __init__(
53-
self,
54-
question: Answerable | None = None,
55-
resolution: Resolvable | None = None,
53+
self, question: Answerable | None = None, resolution: Resolvable | None = None
5654
) -> None:
5755
self.question = question
5856
self.resolution = resolution
@@ -91,7 +89,7 @@ def perform_as(self, the_actor: Actor) -> None:
9189

9290
try:
9391
the_actor.attempts_to(
94-
Silently(Eventually(See.the(self.question, self.resolution))),
92+
Silently(Eventually(See.the(self.question, self.resolution)))
9593
)
9694
except DeliveryError as caught_exception:
9795
msg = (

screenpy/configuration.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,10 @@ def __call__(self) -> dict[str, Any]:
102102

103103
for field_name, field in self.settings_cls.model_fields.items():
104104
field_value, field_key, value_is_complex = self.get_field_value(
105-
field,
106-
field_name,
105+
field, field_name
107106
)
108107
field_value = self.prepare_field_value(
109-
field_name,
110-
field,
111-
field_value,
112-
value_is_complex=value_is_complex,
108+
field_name, field, field_value, value_is_complex=value_is_complex
113109
)
114110
if field_value is not None:
115111
toml_config[field_key] = field_value

screenpy/narration/narrator.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,50 +203,39 @@ def narrate(self, channel: str, **kwargs: Kwargs | None) -> AbstractContextManag
203203
enclosed_func = self._dummy_entangle(channel_kws["func"])
204204
channel_kws["func"] = lambda: "overflow"
205205
self.backed_up_narrations[-1].append(
206-
(channel, channel_kws, self.exit_level),
206+
(channel, channel_kws, self.exit_level)
207207
)
208208
else:
209209
enclosed_func = self._entangle_func(channel, None, **channel_kws)
210210

211211
return enclosed_func
212212

213213
def announcing_the_act(
214-
self,
215-
func: Callable,
216-
line: str,
217-
gravitas: str | None = None,
214+
self, func: Callable, line: str, gravitas: str | None = None
218215
) -> AbstractContextManager:
219216
"""Narrate the title of the act."""
220217
if not self.on_air:
221218
return self._dummy_entangle(func)
222219
return self.narrate("act", func=func, line=line, gravitas=gravitas)
223220

224221
def setting_the_scene(
225-
self,
226-
func: Callable,
227-
line: str,
228-
gravitas: str | None = None,
222+
self, func: Callable, line: str, gravitas: str | None = None
229223
) -> AbstractContextManager:
230224
"""Narrate the title of the scene."""
231225
if not self.on_air:
232226
return self._dummy_entangle(func)
233227
return self.narrate("scene", func=func, line=line, gravitas=gravitas)
234228

235229
def stating_a_beat(
236-
self,
237-
func: Callable,
238-
line: str,
239-
gravitas: str | None = None,
230+
self, func: Callable, line: str, gravitas: str | None = None
240231
) -> AbstractContextManager:
241232
"""Narrate an emotional beat."""
242233
if not self.on_air:
243234
return self._dummy_entangle(func)
244235
return self.narrate("beat", func=func, line=line, gravitas=gravitas)
245236

246237
def whispering_an_aside(
247-
self,
248-
line: str,
249-
gravitas: str | None = None,
238+
self, line: str, gravitas: str | None = None
250239
) -> AbstractContextManager:
251240
"""Narrate a conspiratorial aside (as a stage-whisper)."""
252241
if not self.on_air:

screenpy/narration/stdout_adapter/stdout_adapter.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class StdOutAdapter:
8181
NORMAL: logging.WARNING,
8282
HEAVY: logging.CRITICAL,
8383
EXTREME: logging.ERROR,
84-
},
84+
}
8585
)
8686

8787
def __init__(self, stdout_manager: StdOutManager | None = None) -> None:
@@ -106,10 +106,7 @@ def func_wrapper(*args: P.args, **kwargs: P.kwargs) -> Callable[P, T]:
106106
yield func_wrapper
107107

108108
def scene(
109-
self,
110-
func: Callable,
111-
line: str,
112-
gravitas: str | None = None,
109+
self, func: Callable, line: str, gravitas: str | None = None
113110
) -> Generator:
114111
"""Wrap the scene, to log the stylized title."""
115112

@@ -133,10 +130,7 @@ def beat(self, func: Callable, line: str, gravitas: str | None = None) -> Genera
133130
yield func
134131

135132
def aside(
136-
self,
137-
func: Callable,
138-
line: str,
139-
gravitas: str | None = None,
133+
self, func: Callable, line: str, gravitas: str | None = None
140134
) -> Generator:
141135
"""Encapsulate the aside within the manager's log context."""
142136
if not gravitas:

screenpy/pacing.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def function_should_log_none(func: Callable[P, T]) -> bool:
3636

3737

3838
def act(
39-
title: str,
40-
gravitas: str | None = None,
39+
title: str, gravitas: str | None = None
4140
) -> Callable[[Callable[P, T]], Callable[P, T]]:
4241
"""Decorator to mark an "act".
4342
@@ -61,8 +60,7 @@ def decorator(func: Callable[P, T]) -> Callable[P, T]:
6160

6261

6362
def scene(
64-
title: str,
65-
gravitas: str | None = None,
63+
title: str, gravitas: str | None = None
6664
) -> Callable[[Callable[P, T]], Callable[P, T]]:
6765
"""Decorator to mark a "scene".
6866
@@ -86,8 +84,7 @@ def decorator(func: Callable[P, T]) -> Callable[P, T]:
8684

8785

8886
def beat(
89-
line: str,
90-
gravitas: str | None = None,
87+
line: str, gravitas: str | None = None
9188
) -> Callable[[Callable[P, T]], Callable[P, T]]:
9289
"""Decorator to describe a "beat" (a step in a test).
9390

screenpy/protocols.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,15 @@ def act(self, func: Callable, line: str, gravitas: str | None = None) -> Generat
115115
"""Handle narrating an Act, which designates a group of tests."""
116116

117117
def scene(
118-
self,
119-
func: Callable,
120-
line: str,
121-
gravitas: str | None = None,
118+
self, func: Callable, line: str, gravitas: str | None = None
122119
) -> Generator:
123120
"""Handle narrating a Scene, which designates a subgroup of tests."""
124121

125122
def beat(self, func: Callable, line: str, gravitas: str | None = None) -> Generator:
126123
"""Handle narrating a Beat, which is a step in a test."""
127124

128125
def aside(
129-
self,
130-
func: Callable,
131-
line: str,
132-
gravitas: str | None = None,
126+
self, func: Callable, line: str, gravitas: str | None = None
133127
) -> Generator:
134128
"""Handle narrating an Aside, which can happen any time."""
135129

screenpy/resolutions/custom_matchers/is_in_bounds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ def _matches(self, item: float) -> bool:
5656
def describe_to(self, description: Description) -> None:
5757
"""Describe the passing case."""
5858
description.append_text(
59-
f"the number is within the range of {self.minorant} and {self.majorant}",
59+
f"the number is within the range of {self.minorant} and {self.majorant}"
6060
)
6161

6262
def describe_match(self, item: float, match_description: Description) -> None:
6363
"""Describe the match."""
6464
match_description.append_text(
65-
f"{item} was within the range of {self.minorant} and {self.majorant}",
65+
f"{item} was within the range of {self.minorant} and {self.majorant}"
6666
)
6767

6868
def describe_mismatch(self, item: float, mismatch_description: Description) -> None:
6969
"""Describe the failing case."""
7070
mismatch_description.append_text(
7171
f"{item} does not fall within the range of"
72-
f" {self.minorant} and {self.majorant}",
72+
f" {self.minorant} and {self.majorant}"
7373
)
7474

7575

@@ -86,7 +86,7 @@ def is_in_bounds(*bounds: float | str) -> IsInBounds:
8686
r"[\-, ]+?" # any number of comma, dash and space
8787
r"(?P<majorant>-?(\d+\.?\d*)|(\.\d+))" # majorant (int or float)
8888
r"(?P<upper>[])]?)" # ) or ]
89-
r"$", # end of line
89+
r"$" # end of line
9090
)
9191
matched = re.match(pattern, bounding_string)
9292
if matched is None:

screenpy/resolutions/custom_matchers/sequence_containing_pattern.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,22 @@ def _matches(self, item: Sequence[str]) -> bool:
2626
def describe_to(self, description: Description) -> None:
2727
"""Describe the passing case."""
2828
description.append_text(
29-
f"a sequence containing an element which matches r'{self.pattern}'",
29+
f"a sequence containing an element which matches r'{self.pattern}'"
3030
)
3131

3232
def describe_match(self, _: Sequence[str], match_description: Description) -> None:
3333
"""Describe the match, for use with IsNot."""
3434
match_description.append_text(f"it contains an item matching r'{self.pattern}'")
3535

3636
def describe_mismatch(
37-
self,
38-
item: Sequence[str],
39-
mismatch_description: Description,
37+
self, item: Sequence[str], mismatch_description: Description
4038
) -> None:
4139
"""Describe the failing case."""
4240
if item is None or not hasattr(item, "__iter__"):
4341
mismatch_description.append_text("was not a sequence")
4442
return
4543
mismatch_description.append_text(
46-
f"did not contain an item matching r'{self.pattern}'",
44+
f"did not contain an item matching r'{self.pattern}'"
4745
)
4846

4947

0 commit comments

Comments
 (0)