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

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

Closed
lorenzwalthert opened this issue Mar 14, 2018 · 8 comments
Closed

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

lorenzwalthert opened this issue Mar 14, 2018 · 8 comments

Comments

@lorenzwalthert
Copy link
Collaborator

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?

@krlmlr
Copy link
Member

krlmlr commented Mar 21, 2018

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.

@lorenzwalthert
Copy link
Collaborator Author

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.

@krlmlr
Copy link
Member

krlmlr commented Mar 23, 2018

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

@lorenzwalthert
Copy link
Collaborator Author

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.

@krlmlr
Copy link
Member

krlmlr commented Mar 23, 2018

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

@lorenzwalthert
Copy link
Collaborator Author

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.

@krlmlr
Copy link
Member

krlmlr commented Mar 23, 2018

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

@lorenzwalthert
Copy link
Collaborator Author

ok.

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

No branches or pull requests

2 participants