Skip to content

Commit 1c5b8c1

Browse files
committed
refactor: update regex pattern syntax and improve code readability
1 parent df5a9fc commit 1c5b8c1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

check50/_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _compile_check(name, check):
5959
if check_name[0].isdigit():
6060
check_name = f"_{check_name}"
6161

62-
if not re.match("\w+", check_name):
62+
if not re.match(r"\w+", check_name):
6363
raise CompileError(
6464
_("{} is not a valid name for a check; check names should consist only of alphanumeric characters, underscores, and spaces").format(name))
6565

check50/regex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
def decimal(number):
5-
"""
5+
r"""
66
Create a regular expression to match the number exactly:
77
88
In case of a positive number::

check50/runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def wrapper(run_root_dir, dependency_state):
160160
finally:
161161
result.log = _log if len(_log) <= max_log_lines else ["..."] + _log[-max_log_lines:]
162162
result.data = _data
163-
return result, state
163+
164+
return result, state
164165
return wrapper
165166
return decorator
166167

0 commit comments

Comments
 (0)