traversc / qs

Quick serialization of R objects
397 stars 19 forks source link

Harmonize code style #61

Closed salim-b closed 2 years ago

salim-b commented 2 years ago

Various non-semantic code changes resulting in more consistent style.

traversc commented 2 years ago

Looks good! A space after if at first is weird to me, but I understand the rationale. Just checking, you are following R-studio's style guide?

salim-b commented 2 years ago

Just checking, you are following R-studio's style guide?

Yeah, not completely, i.e. I didn't go all the way... to have real conformance with the Tidyverse Style Guide (from the RStudio devs), a few more re-formattings would be necessary. But this could actually be achieved (at least to some degree) with the help of styler::style_file/dir/pkg().

And there's also lintr which could be used via GitHub Actions to automatically lint all PRs (besides its ability to lint locally). Note that you can easily customize lintr's targets, e.g. setting a desired line width of 160 characters for example using line_length_linter = line_length_linter(160) in its config etc.