-
Notifications
You must be signed in to change notification settings - Fork 73
When Roxygen comment block ends with a tag, the stylerignore directives are ignored #1067
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
Comments
Thanks for the reprex. I agree, this is not what we are after. |
I know that this is not what we want, but the styler annotations are creating problematic formatting. I have created issues to track this. - r-lib/styler#1067 - r-lib/styler#1072 We can revisit this once they are resolved.
To me, it seems rather that roxygen code sequences are not recognized as such if they don't end with an styler::style_text(
"
#' @export
#' @examples
#' x=1
"
)
#> #' @export
#> #' @examples
#> #' x=1 Created on 2022-12-27 with reprex v2.0.2 If we fixed that, I don't think current behavior would do what you wanted. I am not even sure roxygen code comments are stylerignored in any way. |
I think they are: #1085 (comment) |
Should the issue be reopened or did #1089 fully solve the issue? |
This was difficult to track down, but I finally have a minimal reprex to show the issue.
When the Roxygen comment ends with a tag (any tag), the stylerignore directives are ignored.
For example, here the Roxygen comment block is surrounded by the stylerignore directives, and yet the code in examples is styled.
And I think that this has something to do with the tag at the end, because if you relocate it to any other position in the comment block, we get the expected behaviour.
Created on 2022-11-23 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: