Skip to content

Commit 6bd9f75

Browse files
Merge branch 'master' into patch-1
2 parents eb8ad09 + 8f42440 commit 6bd9f75

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
when there are no comments before or after the blank line (#629, #630, #635).
77
- added an option (`styler.test_dir_writeable`) that changes test behavior
88
to not directly modify test files in the current directory (#548).
9+
- `style_file()` and friends gain argument `dry` to control if changes should
10+
be applied to files or not (#634).
911

1012
## Minor chnages and fixes
1113

R/io.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ transform_utf8_one <- function(path, fun, dry) {
3333
if (!identical) {
3434
if (dry == "fail") {
3535
rlang::abort(
36-
paste0("File `", path, "` would be modified by styler and `dry` = 'fail'."),
36+
paste0(
37+
"File `", path, "` would be modified by styler and argument dry",
38+
" is set to 'fail'."
39+
),
3740
class = "dryError"
3841
)
3942
} else if (dry == "on") {

R/ui-styling.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ NULL
2222
#' @inheritParams prettify_pkg
2323
#' @section Warning:
2424
#' This function overwrites files (if styling results in a change of the
25-
#' code to be formatted). It is strongly suggested to only style files
26-
#' that are under version control or to create a backup copy.
25+
#' code to be formatted and `dry = "off"`). It is strongly suggested to only
26+
#' style files that are under version control or to create a backup copy.
2727
#'
2828
#' We suggest to first style with `scope < "tokens"` and inspect and commit
2929
#' changes, because these changes are guaranteed to leave the abstract syntax

man/style_dir.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/style_file.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/style_pkg.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)