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

linters #34

Open
nmvross opened this issue Mar 7, 2024 · 2 comments
Open

linters #34

nmvross opened this issue Mar 7, 2024 · 2 comments

Comments

@nmvross
Copy link

nmvross commented Mar 7, 2024

I'm seeking guidance on how to use linters in my own office as we transition more work to R, and would like advice about best practices/recommended packages for linting R code :) @steeleb

@steeleb
Copy link
Collaborator

steeleb commented Mar 7, 2024

I'm not sure any of us are consistently using a linter yet!! Here are two options:

You can get the super high-level {styler} which integrates into RStudio: https://www.tidyverse.org/blog/2017/12/styler-1.0.0/ and has a few 'preset' settings for style (including tidyverse).

There is also {lintr}: https://www.tidyverse.org/blog/2022/07/lintr-3-0-0/, which is arguably more robust, but is also specific to tidyverse (I think).

I'll be 100% honest that I haven't used {styler} that much, even though it's installed in my IDE (likely to the dismay of my primary code reviewer @mbrousil who graciously tags my inconsistent use of spaces and assignments, which would be caught by this linter), in part because I haven't ingrained it into my personal habits yet. This is maybe a good reminder to do so!

MB, do you have any suggestions here?

@mbrousil
Copy link
Contributor

mbrousil commented Mar 7, 2024

Historically I've used {lintr} and haven't tried {styler}! I've enjoyed it. Mostly I use it when things are heading towards a final version.

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

No branches or pull requests

3 participants