mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Apply refurb/ruff rule FURB167 (#11857)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
18394ae96b
commit
6de9e0cdfd
@ -101,7 +101,7 @@ _id_prefix = [None, 'c.', 'Cv2.']
|
||||
# so when _max_id changes, make sure to update the ENV_VERSION.
|
||||
|
||||
_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.DOTALL)
|
||||
|
||||
# bool, complex, and imaginary are macro "keywords", so they are handled separately
|
||||
_simple_type_specifiers_re = re.compile(r"""
|
||||
|
@ -312,7 +312,7 @@ udl_identifier_re = re.compile(r'''
|
||||
[a-zA-Z_][a-zA-Z0-9_]*\b # note, no word boundary in the beginning
|
||||
''', re.VERBOSE)
|
||||
_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.DOTALL)
|
||||
_visibility_re = re.compile(r'\b(public|private|protected)\b')
|
||||
_operator_re = re.compile(r'''
|
||||
\[\s*\]
|
||||
|
@ -34,7 +34,7 @@ logger = logging.getLogger(__name__)
|
||||
# RE for option descriptions
|
||||
option_desc_re = re.compile(r'((?:/|--|-|\+)?[^\s=]+)(=?\s*.*)')
|
||||
# RE for grammar tokens
|
||||
token_re = re.compile(r'`((~?\w*:)?\w+)`', re.U)
|
||||
token_re = re.compile(r'`((~?\w*:)?\w+)`')
|
||||
|
||||
samp_role = EmphasizedLiteral()
|
||||
|
||||
|
@ -145,7 +145,7 @@ class GoogleDocstring:
|
||||
"""
|
||||
|
||||
_name_rgx = re.compile(r"^\s*((?::(?P<role>\S+):)?`(?P<name>~?[a-zA-Z0-9_.-]+)`|"
|
||||
r" (?P<name2>~?[a-zA-Z0-9_.-]+))\s*", re.X)
|
||||
r" (?P<name2>~?[a-zA-Z0-9_.-]+))\s*", re.VERBOSE)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -324,11 +324,11 @@ class EmphasizedLiteral(SphinxRole):
|
||||
return result
|
||||
|
||||
|
||||
_abbr_re = re.compile(r'\((.*)\)$', re.S)
|
||||
_abbr_re = re.compile(r'\((.*)\)$', re.DOTALL)
|
||||
|
||||
|
||||
class Abbreviation(SphinxRole):
|
||||
abbr_re = re.compile(r'\((.*)\)$', re.S)
|
||||
abbr_re = re.compile(r'\((.*)\)$', re.DOTALL)
|
||||
|
||||
def run(self) -> tuple[list[Node], list[system_message]]:
|
||||
options = self.options.copy()
|
||||
|
Loading…
Reference in New Issue
Block a user