-
Notifications
You must be signed in to change notification settings - Fork 195
Correctly parse checkUsage when a multiline warning is encountered #758
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
Conversation
|
Diff coverage needs a test for |
|
I've only tried this fix on one (very messy) file so far, but lintr is exiting with a new error before it gets to the multiline expression I wanted to test: When linting with the released version of lintr the next message emitted is a "Lines should not be more than 80 characters" -- if |
|
This seems vaguely related to #742. |
# Conflicts: # R/object_usage_linter.R # tests/testthat/test-object_usage_linter.R
|
We're still getting NA locations if the info doesn't match on the first line of the checkUsage info. |
add tests for 100% coverage
|
Now working without error and with correct messages for the case I reported above, but for completeness I can report narrowed the offending lines down to an if-else with unbound names in both conditions: Again, as of 9209e7a lintr is correctly warning on both lines and not erroring. |
|
Thanks for checking this out @infotroph. |
| foo <- function(x) { | ||
| with( | ||
| x, | ||
| `\u2019regex_kill` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test here is a symbol name that's not matched by our regex? so that the linter has to default to where the expression starts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test causes the boundary, res$name, boundary regex to not match against the source code, yes.
fixes #507