Skip to content

Rtex code extraction problematic #1043

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

Open
AshesITR opened this issue Apr 2, 2022 · 1 comment
Open

Rtex code extraction problematic #1043

AshesITR opened this issue Apr 2, 2022 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@AshesITR
Copy link
Collaborator

AshesITR commented Apr 2, 2022

When bringing #165 up to speed, I noticed a test failure for Rtex, caused by the behavior of get_source_expressions():

get_source_expressions("tests/testthat/knitr_formats/test.Rtex")$lines[[25]]
#> [1] " "

The original file line in question is "%", where the % is masked by whitespace as part of the Rtex markup.
This results in a false positive trailing_whitespace_linter() hit for that line once it's extended to cover all lines and not just lines with expressions.

@MichaelChirico
Copy link
Collaborator

Copying over some more context from a TODO comment:

file_lines contains a whitespace on the final line for Rtex, because that is used to mark the Rtex escape char "%" as well. c.f. get_source_expressions("tests/testthat/knitr_formats/test.Rtex")$lines[[25]]

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

No branches or pull requests

2 participants