Using custom style guides with the new reformat on save functionality

The new reformat documents on save functionality in RStudio lets you use styler to reformat the code.

Is there any way to use custom style guides other than the standard styler::tidyverse_style() with this functionality, like you can with the styler addin and functions?

1 Like

Yes, you can use a custom style guide by setting options(styler.addins_style = your_custom_style), where your_custom_style is a function defining your preferred formatting. This should apply when using "Reformat on Save" in RStudio.

I know about the option styler.addins_style_transformer described here, and also discussed in the comments on the format R codes on save feature request issue on GitHub. I have used this for a while when using the styler addin for RStudio, and it's working great.

I can't seem to find any documentation about an option styler.addins_style.

I've now tried to use both these options to make the new built in "reformat on save" feature in RStudio use something other than the default tidyverse_style, but it does not seem to work here.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.