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

style guide metadata #2

Open
lorenzwalthert opened this issue Oct 14, 2021 · 5 comments
Open

style guide metadata #2

lorenzwalthert opened this issue Oct 14, 2021 · 5 comments
Assignees

Comments

@lorenzwalthert
Copy link

This will fool the cache if you have {styler} 1.0.0 installed and the input corresponds to the tidyverse style guide:
https://github.com/ropensci-review-tools/spaceout/blob/main/R/space-guide.R#L24

According to the docs (here: https://styler.r-lib.org/dev/articles/distribute_custom_style_guides.html and here: https://styler.r-lib.org/dev/reference/create_style_guide.html), the idea is to use for style_guide_name the following: spaceout::spaceout_style@https://github.com/ropensci-review-tools".

@maelle
Copy link
Contributor

maelle commented Dec 3, 2024

@mpadge had you made a change related to this?

@mpadge
Copy link
Member

mpadge commented Dec 3, 2024

I've no idea anymore, but this definitely all works for me. I use standard spaceout style in all my language servers and precommit routines, and everything is fine. I guess we can close this?

@lorenzwalthert
Copy link
Author

it will work fo you if you never style the same input with the tidyverse style guilde as well :D . But cache issues will arise and are hard to track down.
Just add this to you code here and you are safe:

    style$style_guide_version <- "1.0.0"
    style$style_guide_name <- "spaceout::spaceout_style@https://github.com/ropensci-review-tools"

@mpadge
Copy link
Member

mpadge commented Dec 3, 2024

Thanks @lorenzwalthert , but what if my styler version is current (1.10.3), and not 1.1.0? And if I clear my caches often enough that there's no cached version of styler 1.0.0?

@lorenzwalthert
Copy link
Author

For style guide version you best take the version of the style guide package, e.g. packageVersion('spaceout').

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