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

Rename .Rraw to just .R? #5830

Open
MichaelChirico opened this issue Dec 15, 2023 · 10 comments
Open

Rename .Rraw to just .R? #5830

MichaelChirico opened this issue Dec 15, 2023 · 10 comments

Comments

@MichaelChirico
Copy link
Member

Is there any reason not to use the "normal" R extension on these files? I don't see anything that distinguishes them from other .R files. The disadvantages of .Rraw are (1) syntax highlighting is disabled by most software that would usually understand the .R extension and (2) new contributors may be confused about what's so special about these files that they get an unknown extension. I don't see any advantages.

@jangorecki
Copy link
Member

It may be not good idea considering how big Rraw files are. From the perspective of requiring a lot resources for an IDE. RStudio could possibly try to figure out what packages are being used in the script to suggest to install missing ones.

@MichaelChirico
Copy link
Member Author

After renaming we could also remove the .gitattributes file:

*.Rraw linguist-language=R

@MichaelChirico
Copy link
Member Author

It may be not good idea considering how big Rraw files are. From the perspective of requiring a lot resources for an IDE. RStudio could possibly try to figure out what packages are being used in the script to suggest to install missing ones.

FWIW:

f = "inst/tests/tests.Rraw"
system.time(getParseData(parse(f)))
#    user  system elapsed 
#   0.237   0.000   0.238

system.time(xmlparsedata::xml_parse_data(parse(f)))
#    user  system elapsed 
#   3.779   0.004   3.792

system.time(lintr::get_source_expressions(f))
#    user  system elapsed 
#  28.767   0.264  29.056 

system.time(lintr::lint(f, lintr::missing_package_linter()))
#    user  system elapsed 
#  29.535   0.627  30.234 

i.e. {lintr} takes quite a while to run missing_package_linter() on the file, but most of that is consumed just getting a normalized cache-optimized data structure. After that the actual lint logic runs in <1 second. Pure R parse data of the file also takes .25s. So presumably RStudio could run such script in <1 second total.

@jangorecki
Copy link
Member

I would also look for the initial reason why Rraw was used rather than R.

@TysonStanley
Copy link
Member

It was changed back in 2011 648ea23 for "Name change tests.R to tests.Rraw to pass R CMD check on 64bit R 2.14.0 (using Amazon EC2)"

Seems related to testthat

Here's the comment

# As from v1.7.2, testthat doesn't run the tests.Rraw (hence file name change to .Rraw).
# There were environment issues with system.time() (when run by test_package) that only
# showed up when CRAN maintainers tested on 64bit. Matthew spent a long time including
# testing on 64bit in Amazon EC2. Solution was simply to not run the tests.R from
# testthat, which probably makes sense anyway to speed it up a bit (was running twice
# before).

@MichaelChirico
Copy link
Member Author

Interesting, I never knew we once used {testthat}:

Suggests: chron, ggplot2, plyr, testthat (>= 0.4), hexbin

It looks like that reason is no longer relevant then -- definitely comfortable with renaming.

@jangorecki jangorecki added this to the 1.16.0 milestone Dec 28, 2023
@Nj221102
Copy link
Contributor

Hey there! i want to solve this issue, and it seems like a straightforward fix – just switching up the file extensions from ".Rraw" to ".R". Here's the lineup of all those ".Rraw" files:

froll.Rraw 
tests.Rraw
other.Rraw 
types.Rraw 
nafill.Rraw 
benchmark.Rraw 
programming.Rraw

is there anything else to be done for this?

@MichaelChirico
Copy link
Member Author

Thanks again Nitish! Here is another issue that will create a lot of merge conflicts with existing PRs, so it's on the back burner for now. I'll try and add milestone 1.17.0 to issues that need to wait for the current PR queue to clear a bit before addressing.

@MichaelChirico MichaelChirico modified the milestones: 1.16.0, 1.17.0 Mar 12, 2024
@Nj221102
Copy link
Contributor

Nj221102 commented Mar 13, 2024

Thanks again Nitish! Here is another issue that will create a lot of merge conflicts with existing PRs, so it's on the back burner for now. I'll try and add milestone 1.17.0 to issues that need to wait for the current PR queue to clear a bit before addressing.

Thanks for info, i will work on something else for now :) , and if you don't mind can you please suggest some issue i can work on as a beginner , because right now i am trying to get familiar with codebase by solving issues.

@mfansler
Copy link
Contributor

Might also be worth noting that .Rraw files get compressed (see #3933, #3937), so name changing might need to keep this in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants