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

Custom message fails for string_boundary_linter(), gives 'NA' #2636

Open
MichaelChirico opened this issue Jul 24, 2024 · 2 comments
Open

Custom message fails for string_boundary_linter(), gives 'NA' #2636

MichaelChirico opened this issue Jul 24, 2024 · 2 comments
Labels
bug an unexpected problem or unintended behavior false-positive code that shouldn't lint, but does

Comments

@MichaelChirico
Copy link
Collaborator

lint('grepl("\\\\^", spec)\n', string_boundary_linter())
# <text>:1:7: warning: [string_boundary_linter] NA Doing so is more readable and more efficient.
# grepl("\\^", spec)
#       ^~~~~
@MichaelChirico MichaelChirico added bug an unexpected problem or unintended behavior false-positive code that shouldn't lint, but does labels Jul 24, 2024
@MichaelChirico
Copy link
Collaborator Author

Actually looking more closely, this appears to be a false positive of string_boundary_linter()... grepl("\\^", x) is not the same as startsWith(x, "^"). h/t @olivroy

@olivroy
Copy link
Collaborator

olivroy commented Jul 24, 2024

Indeed grepl("\\^", x) should only be linted as fixed regex linter ;)

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 false-positive code that shouldn't lint, but does
Projects
None yet
Development

No branches or pull requests

2 participants