Apply refurb/ruff rule FURB167 (#11857)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Dimitri Papadopoulos Orfanos 2024-01-08 19:49:21 +01:00 committed by GitHub
parent 18394ae96b
commit 6de9e0cdfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -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"""

View File

@ -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*\]

View File

@ -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()

View File

@ -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,

View File

@ -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()