Skip to content

Commit 007f580

Browse files
committed
refactor: make the regex look nicer with spaces
1 parent 287d0f9 commit 007f580

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

coverage/misc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ def substitute_variables(text: str, variables: Mapping[str, str]) -> str:
244244
dollar_pattern = r"""(?x) # Use extended regex syntax
245245
\$ # A dollar sign,
246246
(?: # then
247-
(?P<dollar>\$) | # a dollar sign, or
248-
(?P<word1>\w+) | # a plain word, or
247+
(?P<dollar> \$ ) | # a dollar sign, or
248+
(?P<word1> \w+ ) | # a plain word, or
249249
\{ # a {-wrapped
250-
(?P<word2>\w+) # word,
251-
(?:
252-
(?P<strict>\?) | # with a strict marker
253-
-(?P<defval>[^}]*) # or a default value
250+
(?P<word2> \w+ ) # word,
251+
(?: # either
252+
(?P<strict> \? ) | # with a strict marker
253+
-(?P<defval> [^}]* ) # or a default value
254254
)? # maybe.
255255
}
256256
)

0 commit comments

Comments
 (0)