Skip to content

Commit 6de9e0c

Browse files
Apply refurb/ruff rule FURB167 (#11857)
Co-authored-by: Adam Turner <[email protected]>
1 parent 18394ae commit 6de9e0c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

sphinx/domains/c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
# so when _max_id changes, make sure to update the ENV_VERSION.
102102

103103
_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
104-
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
104+
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.DOTALL)
105105

106106
# bool, complex, and imaginary are macro "keywords", so they are handled separately
107107
_simple_type_specifiers_re = re.compile(r"""

sphinx/domains/cpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
[a-zA-Z_][a-zA-Z0-9_]*\b # note, no word boundary in the beginning
313313
''', re.VERBOSE)
314314
_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
315-
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
315+
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.DOTALL)
316316
_visibility_re = re.compile(r'\b(public|private|protected)\b')
317317
_operator_re = re.compile(r'''
318318
\[\s*\]

sphinx/domains/std.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# RE for option descriptions
3535
option_desc_re = re.compile(r'((?:/|--|-|\+)?[^\s=]+)(=?\s*.*)')
3636
# RE for grammar tokens
37-
token_re = re.compile(r'`((~?\w*:)?\w+)`', re.U)
37+
token_re = re.compile(r'`((~?\w*:)?\w+)`')
3838

3939
samp_role = EmphasizedLiteral()
4040

sphinx/ext/napoleon/docstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class GoogleDocstring:
145145
"""
146146

147147
_name_rgx = re.compile(r"^\s*((?::(?P<role>\S+):)?`(?P<name>~?[a-zA-Z0-9_.-]+)`|"
148-
r" (?P<name2>~?[a-zA-Z0-9_.-]+))\s*", re.X)
148+
r" (?P<name2>~?[a-zA-Z0-9_.-]+))\s*", re.VERBOSE)
149149

150150
def __init__(
151151
self,

sphinx/roles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ def parse(self, text: str) -> list[Node]:
324324
return result
325325

326326

327-
_abbr_re = re.compile(r'\((.*)\)$', re.S)
327+
_abbr_re = re.compile(r'\((.*)\)$', re.DOTALL)
328328

329329

330330
class Abbreviation(SphinxRole):
331-
abbr_re = re.compile(r'\((.*)\)$', re.S)
331+
abbr_re = re.compile(r'\((.*)\)$', re.DOTALL)
332332

333333
def run(self) -> tuple[list[Node], list[system_message]]:
334334
options = self.options.copy()

0 commit comments

Comments
 (0)