From 0879d069190301f7dab2800a48ba2dc15bed16db Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 19 Sep 2025 19:50:36 +0200 Subject: [PATCH 1/4] Remove Twitter handle from author info and update docs Updated RoxygenNote version and improved consistency in documentation examples and rule descriptions. --- DESCRIPTION | 4 ++-- R/rules-line-breaks.R | 6 +++--- man/alignment_drop_last_expr.Rd | 2 +- man/set_line_break_before_curly_opening.Rd | 8 ++++---- man/style_dir.Rd | 2 +- man/style_pkg.Rd | 2 +- man/styler-package.Rd | 2 +- man/styler_options.Rd | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3418e39e5..2449065a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,7 @@ Authors@R: family = "Patil", role = "aut", email = "patilindrajeet.science@gmail.com", - comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets"))) + comment = c(ORCID = "0000-0003-1995-6531"))) Description: Pretty-prints R code without changing the user's formatting intent. License: MIT + file LICENSE @@ -52,7 +52,7 @@ Roxygen: list(markdown = TRUE, roclets = c( "rd", "namespace", "collate", if (rlang::is_installed("pkgapi")) "pkgapi::api_roclet" else { warning("Please install r-lib/pkgapi to make sure the file API is kept up to date"); NULL})) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Language: en-US Config/testthat/edition: 3 Config/testthat/parallel: true diff --git a/R/rules-line-breaks.R b/R/rules-line-breaks.R index 0ced09d49..673bcab41 100644 --- a/R/rules-line-breaks.R +++ b/R/rules-line-breaks.R @@ -3,11 +3,11 @@ #' Rule: #' * Principle: Function arguments that consist of a braced expression always #' need to start on a new line -#' * Exception: [...] unless it's the last argument and all other +#' * Exception: unless it's the last argument and all other #' arguments fit on the line of the function call -#' * Exception: [...] or they are named. +#' * Exception: or they are named #' * Extension: Also, expressions following on braced expressions also cause a -#' line trigger. +#' line trigger #' @keywords internal #' @examplesIf FALSE #' tryCatch( diff --git a/man/alignment_drop_last_expr.Rd b/man/alignment_drop_last_expr.Rd index f67092d76..269b04993 100644 --- a/man/alignment_drop_last_expr.Rd +++ b/man/alignment_drop_last_expr.Rd @@ -12,7 +12,7 @@ an if, while or for statement or a function call. We don't call about that part, in fact it's important to remove it for alignment. See 'Examples'. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} call( x = 12, y = 3, diff --git a/man/set_line_break_before_curly_opening.Rd b/man/set_line_break_before_curly_opening.Rd index c590b58fc..4f60ca388 100644 --- a/man/set_line_break_before_curly_opening.Rd +++ b/man/set_line_break_before_curly_opening.Rd @@ -11,15 +11,15 @@ Rule: \itemize{ \item Principle: Function arguments that consist of a braced expression always need to start on a new line -\item Exception: \link{...} unless it's the last argument and all other +\item Exception: unless it's the last argument and all other arguments fit on the line of the function call -\item Exception: \link{...} or they are named. +\item Exception: or they are named \item Extension: Also, expressions following on braced expressions also cause a -line trigger. +line trigger } } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} tryCatch( { f(8) diff --git a/man/style_dir.Rd b/man/style_dir.Rd index 62c80e264..ca3060a9b 100644 --- a/man/style_dir.Rd +++ b/man/style_dir.Rd @@ -112,7 +112,7 @@ See section 'Warning' for a good strategy to apply styling safely. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} style_dir("path/to/dir", filetype = c("rmd", ".R")) # the following is identical (because of ... and defaults) diff --git a/man/style_pkg.Rd b/man/style_pkg.Rd index 637cbc9a7..bd347adc9 100644 --- a/man/style_pkg.Rd +++ b/man/style_pkg.Rd @@ -110,7 +110,7 @@ styling whether or not it was actually changed (or would be changed when } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} # the following is identical (because of ... and defaults) # but the first is most convenient: style_pkg(strict = TRUE) diff --git a/man/styler-package.Rd b/man/styler-package.Rd index 8774cdba7..d69914d9e 100644 --- a/man/styler-package.Rd +++ b/man/styler-package.Rd @@ -41,7 +41,7 @@ Useful links: Authors: \itemize{ \item Kirill Müller \email{kirill@cynkra.com} (\href{https://orcid.org/0000-0002-1416-3412}{ORCID}) - \item Indrajeet Patil \email{patilindrajeet.science@gmail.com} (\href{https://orcid.org/0000-0003-1995-6531}{ORCID}) (@patilindrajeets) + \item Indrajeet Patil \email{patilindrajeet.science@gmail.com} (\href{https://orcid.org/0000-0003-1995-6531}{ORCID}) } } diff --git a/man/styler_options.Rd b/man/styler_options.Rd index add90dd39..05a3bd2f3 100644 --- a/man/styler_options.Rd +++ b/man/styler_options.Rd @@ -42,7 +42,7 @@ If \code{TRUE}, the package tests whether the directory is writable. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} getOption("styler.ignore_alignment") options( styler.ignore_alignment = TRUE, From 7b6140707cf81c4268e096bd19a87aaff7662af0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 19 Sep 2025 17:57:18 +0000 Subject: [PATCH 2/4] pre-commit --- man/alignment_drop_last_expr.Rd | 2 +- man/set_line_break_before_curly_opening.Rd | 2 +- man/style_dir.Rd | 2 +- man/style_pkg.Rd | 2 +- man/styler_options.Rd | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/alignment_drop_last_expr.Rd b/man/alignment_drop_last_expr.Rd index 269b04993..f67092d76 100644 --- a/man/alignment_drop_last_expr.Rd +++ b/man/alignment_drop_last_expr.Rd @@ -12,7 +12,7 @@ an if, while or for statement or a function call. We don't call about that part, in fact it's important to remove it for alignment. See 'Examples'. } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} call( x = 12, y = 3, diff --git a/man/set_line_break_before_curly_opening.Rd b/man/set_line_break_before_curly_opening.Rd index 4f60ca388..8501984dd 100644 --- a/man/set_line_break_before_curly_opening.Rd +++ b/man/set_line_break_before_curly_opening.Rd @@ -19,7 +19,7 @@ line trigger } } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} tryCatch( { f(8) diff --git a/man/style_dir.Rd b/man/style_dir.Rd index ca3060a9b..62c80e264 100644 --- a/man/style_dir.Rd +++ b/man/style_dir.Rd @@ -112,7 +112,7 @@ See section 'Warning' for a good strategy to apply styling safely. } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} style_dir("path/to/dir", filetype = c("rmd", ".R")) # the following is identical (because of ... and defaults) diff --git a/man/style_pkg.Rd b/man/style_pkg.Rd index bd347adc9..637cbc9a7 100644 --- a/man/style_pkg.Rd +++ b/man/style_pkg.Rd @@ -110,7 +110,7 @@ styling whether or not it was actually changed (or would be changed when } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # the following is identical (because of ... and defaults) # but the first is most convenient: style_pkg(strict = TRUE) diff --git a/man/styler_options.Rd b/man/styler_options.Rd index 05a3bd2f3..add90dd39 100644 --- a/man/styler_options.Rd +++ b/man/styler_options.Rd @@ -42,7 +42,7 @@ If \code{TRUE}, the package tests whether the directory is writable. } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} getOption("styler.ignore_alignment") options( styler.ignore_alignment = TRUE, From 1e74b24d8d6ce03782eada8a59b470b4bd5ac0be Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 19 Sep 2025 20:03:05 +0200 Subject: [PATCH 3/4] bump hook versions --- .pre-commit-config.yaml | 4 ++-- man/alignment_drop_last_expr.Rd | 2 +- man/set_line_break_before_curly_opening.Rd | 2 +- man/style_dir.Rd | 2 +- man/style_pkg.Rd | 2 +- man/styler_options.Rd | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15e933f66..efdbc2d34 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ default_language_version: repos: - repo: https://github.com/lorenzwalthert/precommit - rev: v0.4.3.9009 + rev: v0.4.3.9014 hooks: - id: style-files args: @@ -101,7 +101,7 @@ repos: )$ - id: pkgdown - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files args: ["--maxkb=200"] diff --git a/man/alignment_drop_last_expr.Rd b/man/alignment_drop_last_expr.Rd index f67092d76..269b04993 100644 --- a/man/alignment_drop_last_expr.Rd +++ b/man/alignment_drop_last_expr.Rd @@ -12,7 +12,7 @@ an if, while or for statement or a function call. We don't call about that part, in fact it's important to remove it for alignment. See 'Examples'. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} call( x = 12, y = 3, diff --git a/man/set_line_break_before_curly_opening.Rd b/man/set_line_break_before_curly_opening.Rd index 8501984dd..4f60ca388 100644 --- a/man/set_line_break_before_curly_opening.Rd +++ b/man/set_line_break_before_curly_opening.Rd @@ -19,7 +19,7 @@ line trigger } } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} tryCatch( { f(8) diff --git a/man/style_dir.Rd b/man/style_dir.Rd index 62c80e264..ca3060a9b 100644 --- a/man/style_dir.Rd +++ b/man/style_dir.Rd @@ -112,7 +112,7 @@ See section 'Warning' for a good strategy to apply styling safely. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} style_dir("path/to/dir", filetype = c("rmd", ".R")) # the following is identical (because of ... and defaults) diff --git a/man/style_pkg.Rd b/man/style_pkg.Rd index 637cbc9a7..bd347adc9 100644 --- a/man/style_pkg.Rd +++ b/man/style_pkg.Rd @@ -110,7 +110,7 @@ styling whether or not it was actually changed (or would be changed when } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} # the following is identical (because of ... and defaults) # but the first is most convenient: style_pkg(strict = TRUE) diff --git a/man/styler_options.Rd b/man/styler_options.Rd index add90dd39..05a3bd2f3 100644 --- a/man/styler_options.Rd +++ b/man/styler_options.Rd @@ -42,7 +42,7 @@ If \code{TRUE}, the package tests whether the directory is writable. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} getOption("styler.ignore_alignment") options( styler.ignore_alignment = TRUE, From 8cb9a1da85d5384e4bd5ce636b15086766808ea6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 19 Sep 2025 18:10:30 +0000 Subject: [PATCH 4/4] pre-commit --- man/alignment_drop_last_expr.Rd | 2 +- man/set_line_break_before_curly_opening.Rd | 2 +- man/style_dir.Rd | 2 +- man/style_pkg.Rd | 2 +- man/styler_options.Rd | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/alignment_drop_last_expr.Rd b/man/alignment_drop_last_expr.Rd index 269b04993..f67092d76 100644 --- a/man/alignment_drop_last_expr.Rd +++ b/man/alignment_drop_last_expr.Rd @@ -12,7 +12,7 @@ an if, while or for statement or a function call. We don't call about that part, in fact it's important to remove it for alignment. See 'Examples'. } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} call( x = 12, y = 3, diff --git a/man/set_line_break_before_curly_opening.Rd b/man/set_line_break_before_curly_opening.Rd index 4f60ca388..8501984dd 100644 --- a/man/set_line_break_before_curly_opening.Rd +++ b/man/set_line_break_before_curly_opening.Rd @@ -19,7 +19,7 @@ line trigger } } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} tryCatch( { f(8) diff --git a/man/style_dir.Rd b/man/style_dir.Rd index ca3060a9b..62c80e264 100644 --- a/man/style_dir.Rd +++ b/man/style_dir.Rd @@ -112,7 +112,7 @@ See section 'Warning' for a good strategy to apply styling safely. } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} style_dir("path/to/dir", filetype = c("rmd", ".R")) # the following is identical (because of ... and defaults) diff --git a/man/style_pkg.Rd b/man/style_pkg.Rd index bd347adc9..637cbc9a7 100644 --- a/man/style_pkg.Rd +++ b/man/style_pkg.Rd @@ -110,7 +110,7 @@ styling whether or not it was actually changed (or would be changed when } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # the following is identical (because of ... and defaults) # but the first is most convenient: style_pkg(strict = TRUE) diff --git a/man/styler_options.Rd b/man/styler_options.Rd index 05a3bd2f3..add90dd39 100644 --- a/man/styler_options.Rd +++ b/man/styler_options.Rd @@ -42,7 +42,7 @@ If \code{TRUE}, the package tests whether the directory is writable. } \examples{ -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} +\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} getOption("styler.ignore_alignment") options( styler.ignore_alignment = TRUE,