Skip to content

Commit 57448ea

Browse files
committed
Bump ruff to 0.8, placate it wrt raw regex strings
1 parent ccff8c3 commit 57448ea

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

course/content.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,10 @@ def is_repo_file_accessible_as(
861861
re.MULTILINE | re.DOTALL)
862862
YAML_BLOCK_START_SCALAR_RE = re.compile(
863863
r"(:\s*[|>])"
864-
"(J?)"
865-
"((?:[0-9][-+]?|[-+][0-9]?)?)"
864+
r"(J?)"
865+
r"((?:[0-9][-+]?|[-+][0-9]?)?)"
866866
r"(?:\s*\#.*)?"
867-
"$")
867+
r"$")
868868

869869
IN_BLOCK_END_RAW_RE = re.compile(r"(.*)({%-?\s*endraw\s*-?%})(.*)")
870870
GROUP_COMMENT_START = re.compile(r"^\s*#\s*\{\{\{")
@@ -1578,7 +1578,7 @@ def apply(self, dtm: datetime.datetime) -> datetime.datetime:
15781578

15791579

15801580
PLUS_DELTA_RE = re.compile(r"^(.*)\s*([+-])\s*([0-9]+)\s+"
1581-
"(weeks?|days?|hours?|minutes?)$")
1581+
r"(weeks?|days?|hours?|minutes?)$")
15821582

15831583

15841584
class PlusDeltaPostprocessor(DatespecPostprocessor):

course/grades.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def view_single_grade(pctx: CoursePageContext, participation_id: str,
904904

905905
request = pctx.request
906906
if pctx.request.method == "POST":
907-
action_re = re.compile("^([a-z]+)_([0-9]+)$")
907+
action_re = re.compile(r"^([a-z]+)_([0-9]+)$")
908908
action_match = None
909909
for key in request.POST.keys():
910910
action_match = action_re.match(key)

course/page/inline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def get_form_field(self, page_context, force_required=False):
531531

532532
WRAPPED_NAME_RE = re.compile(r"[^{](?=(\[\[[^\[\]]*\]\]))[^}]")
533533
NAME_RE = re.compile(r"[^{](?=\[\[([^\[\]]*)\]\])[^}]")
534-
NAME_VALIDATE_RE = re.compile("^[a-zA-Z]+[a-zA-Z0-9_]{0,}$")
534+
NAME_VALIDATE_RE = re.compile(r"^[a-zA-Z]+[a-zA-Z0-9_]{0,}$")
535535

536536

537537
class InlineMultiQuestion(

course/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
import re
8282

8383

84-
CODE_CELL_DIV_ATTRS_RE = re.compile('(<div class="[^>]*code_cell[^>"]*")(>)')
84+
CODE_CELL_DIV_ATTRS_RE = re.compile(r'(<div class="[^>]*code_cell[^>"]*")(>)')
8585

8686

8787
def getattr_with_fallback(

poetry.lock

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ urllib3 = "^1.26.19,<2"
125125

126126
[tool.poetry.dev-dependencies]
127127
factory_boy = "^3.3.1"
128-
ruff = "^0.7.4"
128+
ruff = "^0.8"
129129

130130
django-stubs = { version ="5.1.*", extras = ["compatible-mypy"] }
131131

0 commit comments

Comments
 (0)