Skip to content

Commit

Permalink
Bump ruff to 0.8, placate it wrt raw regex strings
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 25, 2024
1 parent ccff8c3 commit 57448ea
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions course/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,10 @@ def is_repo_file_accessible_as(
re.MULTILINE | re.DOTALL)
YAML_BLOCK_START_SCALAR_RE = re.compile(
r"(:\s*[|>])"
"(J?)"
"((?:[0-9][-+]?|[-+][0-9]?)?)"
r"(J?)"
r"((?:[0-9][-+]?|[-+][0-9]?)?)"
r"(?:\s*\#.*)?"
"$")
r"$")

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


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


class PlusDeltaPostprocessor(DatespecPostprocessor):
Expand Down
2 changes: 1 addition & 1 deletion course/grades.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def view_single_grade(pctx: CoursePageContext, participation_id: str,

request = pctx.request
if pctx.request.method == "POST":
action_re = re.compile("^([a-z]+)_([0-9]+)$")
action_re = re.compile(r"^([a-z]+)_([0-9]+)$")
action_match = None
for key in request.POST.keys():
action_match = action_re.match(key)
Expand Down
2 changes: 1 addition & 1 deletion course/page/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def get_form_field(self, page_context, force_required=False):

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


class InlineMultiQuestion(
Expand Down
2 changes: 1 addition & 1 deletion course/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
import re


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


def getattr_with_fallback(
Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ urllib3 = "^1.26.19,<2"

[tool.poetry.dev-dependencies]
factory_boy = "^3.3.1"
ruff = "^0.7.4"
ruff = "^0.8"

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

Expand Down

0 comments on commit 57448ea

Please sign in to comment.