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

Strip trailing whitespace throughout R/ + tests/testthat #2566

Merged
merged 5 commits into from
May 21, 2024
Merged

Strip trailing whitespace throughout R/ + tests/testthat #2566

merged 5 commits into from
May 21, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented May 21, 2024

As suggested in #2562 (comment)

Since I had to open all files one by one to do this, I made some quick fixes here and there.

  1. Deleted compat-friendly-type.R (it is now import-standalone-obj-type.R
  2. Separated pkgdown into pkgdown.R and pkgdown-package.R
  3. trimmed sections to 80 characters when I saw them.
  4. 2 tests lints
    Whitespace disrepencies probably caused by Global option for Strip trailing horizontal whitespace when saving is ignored rstudio/rstudio#9902. This setting is useful to have when you are on your own projects, but can be disruptive while working on someone else's project.

How I did this

fs::dir_ls("R") |> fs::path_filter(regexp  = "import", invert = T) |> purrr::walk(rstudioapi::documentOpen)

I have the global setting in RStudio to trim whitespace and force files to end with a new line.
Then, I had to do a temp modification (like adding a dot at the end of a comment), then save, then undo my modification. (RStudio will not save if it doesn't detect a change in contents first).

I did this on mac. So, hopefully not too many ghost instance of git change on your side. (r-lib/testthat#1958)

@olivroy olivroy changed the title Strip trailing whitespace throughout R/ Strip trailing whitespace throughout R/ + tests/testthat May 21, 2024
@hadley hadley merged commit 39ea964 into r-lib:main May 21, 2024
13 checks passed
@olivroy olivroy deleted the ws branch May 21, 2024 23:10
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
* Remove trailing WS.
* Use usethis syntax (+ separate pkgdown.R and pkgdown-package.R in 2 files)
* Delete outdated file
* Test lint! (expect_match + expect_null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants