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

extract_r_source() is overly eager with detecting knitr patterns #1406

Closed
AshesITR opened this issue Jun 17, 2022 · 1 comment · Fixed by #1407
Closed

extract_r_source() is overly eager with detecting knitr patterns #1406

AshesITR opened this issue Jun 17, 2022 · 1 comment · Fixed by #1407
Labels
bug an unexpected problem or unintended behavior

Comments

@AshesITR
Copy link
Collaborator

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.

Originally posted by @AshesITR in #1403 (comment)

@AshesITR
Copy link
Collaborator Author

The reason is knitr:::detect_pattern() falls back to returning the first pattern set which matches any chunk begin or inline code if the extension is unknown (which is the case for extension .R).

It's probably safe to assume that any file which parses as R code should be linted as R code, even if it happens to match a knitr pattern.

@AshesITR AshesITR added the bug an unexpected problem or unintended behavior label Jun 17, 2022
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