lubridate icon indicating copy to clipboard operation
lubridate copied to clipboard

Restyle files with styler

Open hadley opened this issue 5 years ago • 7 comments

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

hadley avatar Nov 19 '19 23:11 hadley

Needs to wait until no outstanding PRs

hadley avatar Nov 20 '19 14:11 hadley

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.

lorenzwalthert avatar Nov 28 '19 23:11 lorenzwalthert

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.

hadley avatar Nov 28 '19 23:11 hadley

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

lorenzwalthert avatar Nov 28 '19 23:11 lorenzwalthert

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.

hadley avatar Nov 29 '19 00:11 hadley

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)

lorenzwalthert avatar Nov 29 '19 09:11 lorenzwalthert

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.

vspinu avatar Nov 29 '19 21:11 vspinu