Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rapids_pre_commit_hooks/hardcoded_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def is_todo_doc(lines: "Lines", match: "re.Match[str]") -> bool:
todo_match = TODO_DOC_RE.search(lines.content[start:end])
return (
todo_match is not None
and todo_match.start("version") == start + match.start("full")
and todo_match.end("version") == start + match.end("full")
and start + todo_match.start("version") == match.start("full")
and start + todo_match.end("version") == match.end("full")
)


Expand Down
9 changes: 9 additions & 0 deletions tests/rapids_pre_commit_hooks/test_hardcoded_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,15 @@ def test_is_version_doc(content, expected_value):
True,
id="todo",
),
pytest.param(
"""\
+
+ TODO(26.04)
: ~~~~~match
""",
True,
id="todo-next-line",
),
pytest.param(
"""\
+ TODO something else 26.04
Expand Down
Loading