From e1182968d290d7dec57f96a110da92c1188db92c Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:52:09 +0100 Subject: [PATCH] style: Apply ruff rule RUF039 RUF039 First argument to `re.compile()` is not raw string --- yamllint/rules/float_values.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yamllint/rules/float_values.py b/yamllint/rules/float_values.py index 7c7c60cc..5f2c44e8 100644 --- a/yamllint/rules/float_values.py +++ b/yamllint/rules/float_values.py @@ -106,13 +106,13 @@ } 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):