Skip to content

API change: new argument verbose for style_*()  #375

Closed

Description

@lorenzwalthert

Migrated from #374 (comment).

This may be helpful if stylers are called from within other functions. Alternative: Let developers capture output in these functions and storing them in an object that they will throw away.

silent_style_file <- function(...) {
  msg <- capture.output(style_file(...))

}

@krlmlr what do you think?

Activity

  1. krlmlr commented on Mar 21, 2018

    @krlmlr
    Member

    Agreed. I've seen quiet = FALSE in other (especially tidyverse) packages. Not sure how useful it is to capture the output, when the caller could do that himself.

  2. lorenzwalthert commented on Mar 23, 2018

    @lorenzwalthert
    CollaboratorAuthor

    Agree, let's keep the API slim. I think 90% of the people who would want to use this option are developers and they can write a wrapper around it.

  3. krlmlr commented on Mar 23, 2018

    @krlmlr
    Member

    I don't mind a quiet = FALSE argument, though.

  4. lorenzwalthert commented on Mar 23, 2018

    @lorenzwalthert
    CollaboratorAuthor

    Ok, so I might have gotten you wrong here

    Not sure how useful it is to capture the output, when the caller could do that himself.

    Because I thought that speaks against an additional argument quiet.

  5. krlmlr commented on Mar 23, 2018

    @krlmlr
    Member

    I thought quiet = TRUE wouldn't involve calling capture.output().

  6. lorenzwalthert commented on Mar 23, 2018

    @lorenzwalthert
    CollaboratorAuthor

    If we implement it, sure. But what I showcased above was a way a user / developer can avoid any command line output with the current CRAN version (v1.0.1) of styler.

  7. krlmlr commented on Mar 23, 2018

    @krlmlr
    Member

    quiet = TRUE feels better than asking the caller to capture and then discard our output.

  8. lorenzwalthert commented on Mar 23, 2018

    @lorenzwalthert
    CollaboratorAuthor

    ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions