Skip to content

Commit

Permalink
Simplify expression, allow todo-
Browse files Browse the repository at this point in the history
  • Loading branch information
cbachhuber committed Sep 13, 2024
1 parent b7516e9 commit 9ede23f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev_tools/check_jira_reference_in_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
def line_has_incorrect_todo(line: str) -> bool:
return (
not re.compile(r"^.*(?=TODO\([A-Z]+\-[0-9]+\)\:).*").search(line)
if re.compile(r"^.*(?=(?i:to-?do)|TO DO)(?!todo\w+|toDouble|tOdometry)").search(line)
if re.compile(r"^.*(?=(?i:to[ -]?do))(?!todo[\w-]+|toDouble|tOdometry)", re.ASCII).search(line)
else False
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_check_jira_reference_in_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_line_has_incorrect_todo_for_no_incorrect_todo(content: str) -> None:
assert not line_has_incorrect_todo(content)


@pytest.mark.parametrize("content", ["todoom", "toDouble()", "setOdometry()", "getOdometry"])
@pytest.mark.parametrize("content", ["todoom", "todo-color", "toDouble()", "setOdometry()", "getOdometry"])
def test_line_has_incorrect_todo_for_no_undetected_todo(content: str) -> None:
assert not line_has_incorrect_todo(content)

Expand Down

0 comments on commit 9ede23f

Please sign in to comment.