[x] I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('formatR'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/formatR').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
[x] I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
This is bug.R:
#####
# a #
#####
Then I run formatR::tidy_source("bug.R", file = "bug2.R").
And this is the result:
##### a #
Shouldn't the comment block be maintained by default?
> getOption("formatR.comment", TRUE)
[1] TRUE
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041), RStudio 1.3.1056
Locale:
LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
LC_NUMERIC=C LC_TIME=English_United States.1252
Package version:
formatR_1.7
By filing an issue to this repo, I promise that
xfun::session_info('formatR')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/formatR')
.I understand that my issue may be closed if I don't fulfill my promises.
This is bug.R:
Then I run
formatR::tidy_source("bug.R", file = "bug2.R")
.And this is the result:
Shouldn't the comment block be maintained by default?