-
Notifications
You must be signed in to change notification settings - Fork 186
Don't omit trailing non-code lines from knitr files #1403
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
NEWS.md
Outdated
@@ -5,6 +5,10 @@ | |||
* `seq_linter()` additionally lints on `1:n()` (from dplyr) | |||
and `1:.N` (from data.table) (#1396, @IndrajeetPatil). | |||
|
|||
## Bug fixes | |||
|
|||
* `get_source_expression()` no longer omits trailing non-code lines from knitr files (#1400, @AshesITR). |
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.
get_source_expressions?
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.
That's the affected public facing function.
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.
i mean, is it a typo? i know we have an internal get_source_expression
abc = 123 | ||
``` | ||
|
||
```{r child="some-file.Rmd"} |
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.
false positive lint here?
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.
also note the NA -- seems the linter name has not been picked up correctly
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.
It seems the test code is linted as Rmd for some reason?!
The NA should be investigated in a separate issue. Maybe we stumbled on an actual bug in the extractor code.
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.
Can't seem to find the issue from a quick search but AFAIK that should be related to the known issue where our logic for classifying Rmd is not the best.
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.
Filed #1405 for the NA issue
NEWS.md
Outdated
@@ -5,6 +5,12 @@ | |||
* `seq_linter()` additionally lints on `1:n()` (from dplyr) | |||
and `1:.N` (from data.table) (#1396, @IndrajeetPatil). | |||
|
|||
## Bug fixes | |||
|
|||
* `get_source_expression()` no longer omits trailing non-code lines from knitr files (#1400, @AshesITR). |
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.
still hoping to clarify if it's a typo -- shouldn't this have a trailing s
?
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.
Oh, good catch! Yes, it should.
|
||
# Construct an Rmd file without terminal newline | ||
tmp3 <- withr::local_tempfile() | ||
# TODO (@AshesITR): Remove \n escapes when #1406 is fixed |
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.
nit: btw I think TODO(#1406)
is better in general, then you can assign yourself the issue. makes it easier in case you decide to go on hiatus & not care about the issue for a few years :)
fixes #1400