r-lib / styler

Non-invasive pretty printing of R code
https://styler.r-lib.org
Other
713 stars 70 forks source link

style active package feature request: confirm before doing #1151

Closed sbanville-delfi closed 11 months ago

sbanville-delfi commented 11 months ago

Hi

styler is a great package and very helpful, thanks for creating it!

My feature request is to have the Style active package menu option by default ask the user if they want to really update the code in an entire package. I accidentally did that, and that isn't what I wanted; it's not a huge issue, but I prefer to do large formatting changes (an entire package) in a separate PR to avoid unnecessarily large reviews because of reformatting (my code or someone else's). Undo isn't an option in this scenario it appears.

Thanks, -Steven

IndrajeetPatil commented 11 months ago

You should be using version control system (e.g. git) with your project. This will allow you to revert any changes you don't wish to commit to the codebase.

You can also check out the dry parameter:

https://styler.r-lib.org/reference/style_pkg.html

sbanville-delfi commented 11 months ago

Thanks, I will check out the link.

W.r.t.

You should be using version control system (e.g. git) with your project. This will allow you to revert any changes you don't wish to commit to the codebase.

I am, this just happened before committing the current non-formatting changes. At least it isn't a big issue, just inconvenient.