tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
731 stars 207 forks source link

Restyle files with styler #819

Open hadley opened 4 years ago

hadley commented 4 years ago

To ensure consistent with latest tidyverse styling guidelines; this makes it easier for others contribute.

hadley commented 4 years ago

Needs to wait until no outstanding PRs

lorenzwalthert commented 4 years ago

What about using the styler hook from lorenzwalthert/precommit? I aim for a CRAN release before the end of the year. I am also happy to transfer the repo to r-lib if this would be a pre-condition to use it in any tidyverse repo.

hadley commented 4 years ago

I don’t really like the pre-commit approach, and if we did use it, it would be better to pilot it on a package that is already close to the standard style.

lorenzwalthert commented 4 years ago

Ok. May I ask why you don’t like it?

hadley commented 4 years ago

It requires conda so that you can install https://pre-commit.com, which is a "multi-language package manager". It feels like you are solving a small problem with a large chain saw. I'd much rather solve with github actions.

lorenzwalthert commented 4 years ago

Ok, thanks for clarifying. You need at least python for pre-commit.com, the R package provides a default installation mechanism easily accessible from R that requires conda, but the executable can also be installed differently and later be linked to use the R package. On the other hand, my understanding of using styler and other correction tools with ghactions is that it will create new commits and convolute the git history whereas the pre-commit approach can tackle problem before they enter version control. Need to learn more about ghactions though.

(sorry to lead this discussion off topic)

vspinu commented 4 years ago

To ensure consistent with latest tidyverse styling guidelines;

I hope they are not too opinionated and Rstudio centric. Otherwise, I am completely fine with this idea.