Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

todo_comment_linter(except_regex=) fails with capture groups #2678

Open
MichaelChirico opened this issue Oct 27, 2024 · 1 comment · May be fixed by #2679
Open

todo_comment_linter(except_regex=) fails with capture groups #2678

MichaelChirico opened this issue Oct 27, 2024 · 1 comment · May be fixed by #2679
Labels
bug an unexpected problem or unintended behavior

Comments

@MichaelChirico
Copy link
Collaborator

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.

@MichaelChirico MichaelChirico added the bug an unexpected problem or unintended behavior label Oct 27, 2024
@MichaelChirico
Copy link
Collaborator Author

Filed r-lib/rex#94 as an upstream FR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant