Skip to content

todo_comment_linter(except_regex=) fails with capture groups #2678

@MichaelChirico

Description

@MichaelChirico
lint("# abc\n", todo_comment_linter('abc', except_regex = "(abc)"))
# Error in `h()`:
# ! Linter `linter()` failed in /tmp/Rtmp6XgIZm/file2adee8120fb1df:
# invalid argument type
# Run `rlang::last_trace()` to see where the error occurred.

The error is really confusing too. It's easy to forget to use ?: when writing a regex (and it's not clear that's a good requirement). Primarily this is due to rex::re_matches() changing output type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions