style: Apply ruff rule RUF039

RUF039 First argument to `re.compile()` is not raw string
This commit is contained in:
Dimitri Papadopoulos
2024-12-17 22:52:09 +01:00
committed by Adrien Vergé
parent 8513d9b97d
commit e1182968d2

View File

@@ -106,13 +106,13 @@ DEFAULT = {
}
IS_NUMERAL_BEFORE_DECIMAL_PATTERN = (
re.compile('[-+]?(\\.[0-9]+)([eE][-+]?[0-9]+)?$')
re.compile(r'[-+]?(\.[0-9]+)([eE][-+]?[0-9]+)?$')
)
IS_SCIENTIFIC_NOTATION_PATTERN = re.compile(
'[-+]?(\\.[0-9]+|[0-9]+(\\.[0-9]*)?)([eE][-+]?[0-9]+)$'
r'[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)$'
)
IS_INF_PATTERN = re.compile('[-+]?(\\.inf|\\.Inf|\\.INF)$')
IS_NAN_PATTERN = re.compile('(\\.nan|\\.NaN|\\.NAN)$')
IS_INF_PATTERN = re.compile(r'[-+]?(\.inf|\.Inf|\.INF)$')
IS_NAN_PATTERN = re.compile(r'(\.nan|\.NaN|\.NAN)$')
def check(conf, token, prev, next, nextnext, context):