Skip to content

Argument / option to apply re-style code with styler #108

@jennybc

Description

@jennybc

I'm switching from formatR::tidy_source() to styler::style_text() (#94). The most specific motivation is styler's ability to handle tidy eval code. Currently reprex re-styles code that came via expression, because the srcref approach mutilates leading whitespace.

Now that I'm playing with styler I wonder if reprex should re-style all code. At least by default?

I could add an argument to control re-styling, that defaults to TRUE. BTW I have plans to make several arguments like this settable via an option, so they're easy to set in a startup file.

This would have the effect of putting good code style in front of the eyeballs of all reprex authors and consumers.

cc @hadley @jimhester

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions