Skip to content

Commit 88ee57c

Browse files
Merge pull request #977 from r-lib/f-ui-tweaks
Tweaks to style_pkg()
2 parents 2fa7369 + c6ba87f commit 88ee57c

File tree

8 files changed

+28
-20
lines changed

8 files changed

+28
-20
lines changed

API

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ specify_reindention(regex_pattern = NULL, indention = 0, comments_only = TRUE)
1313
specify_transformers_drop(spaces = NULL, indention = NULL, line_breaks = NULL, tokens = NULL)
1414
style_dir(path = ".", ..., style = tidyverse_style, transformers = style(...), filetype = c("R", "Rprofile", "Rmd", "Rmarkdown", "Rnw", "Qmd"), recursive = TRUE, exclude_files = NULL, exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off")
1515
style_file(path, ..., style = tidyverse_style, transformers = style(...), include_roxygen_examples = TRUE, base_indention = 0, dry = "off")
16-
style_pkg(pkg = ".", ..., style = tidyverse_style, transformers = style(...), filetype = c("R", "Rprofile", "Rmd", "Rmarkdown", "Rnw", "Qmd"), exclude_files = "R/RcppExports.R", exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off")
16+
style_pkg(pkg = ".", ..., style = tidyverse_style, transformers = style(...), filetype = c("R", "Rprofile", "Rmd", "Rmarkdown", "Rnw", "Qmd"), exclude_files = c("R/RcppExports.R", "R/cpp11.R"), exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off")
1717
style_text(text, ..., style = tidyverse_style, transformers = style(...), include_roxygen_examples = TRUE, base_indention = 0)
1818
tidyverse_math_token_spacing()
1919
tidyverse_reindention()

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ editor_options:
1111
- `style_dir()` and `style_pkg()` now default to styling all supported file
1212
formats (`.R`, `.Rmd`, `.Rmarkdown`, `.Rnw`, and `.qmd`) in the (package)
1313
directory (\@IndrajeetPatil, #965).
14+
- `style_pkg()` now excludes the auto-generated `R/cpp11.R` file (#977).
1415

1516
**Features**
1617

R/ui-styling.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ NULL
66
#' Prettify R source code
77
#'
88
#' Performs various substitutions in all `.R` files in a package
9-
#' (code and tests). One can also (optionally) style `.Rmd`, `.Rmarkdown` and/or
10-
#' `.qmd`, `.Rnw` files (vignettes and readme) by changing the `filetype`
11-
#' argument.
9+
#' (code and tests), `.Rmd`, `.Rmarkdown` and/or
10+
#' `.qmd`, `.Rnw` files (vignettes and readme).
1211
#' Carefully examine the results after running this function!
1312
#'
1413
#' @param pkg Path to a (subdirectory of an) R package.
15-
#' @param ... Arguments passed on to the `style` function.
14+
#' @param ... Arguments passed on to the `style` function,
15+
#' see [tidyverse_style()] for the default argument.
1616
#' @param style A function that creates a style guide to use, by default
17-
#' [tidyverse_style()] (without the parentheses). Not used
17+
#' [`tidyverse_style`]. Not used
1818
#' further except to construct the argument `transformers`. See
1919
#' [style_guides()] for details.
2020
#' @param transformers A set of transformer functions. This argument is most
@@ -76,7 +76,7 @@ style_pkg <- function(pkg = ".",
7676
style = tidyverse_style,
7777
transformers = style(...),
7878
filetype = c("R", "Rprofile", "Rmd", "Rmarkdown", "Rnw", "Qmd"),
79-
exclude_files = "R/RcppExports.R",
79+
exclude_files = c("R/RcppExports.R", "R/cpp11.R"),
8080
exclude_dirs = c("packrat", "renv"),
8181
include_roxygen_examples = TRUE,
8282
base_indention = 0,

inst/WORDLIST

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ config
2828
CONST
2929
coventions
3030
covr
31+
cpp
3132
cran
3233
cre
34+
cynkra
3335
datastructures
3436
dec
3537
deps
@@ -95,6 +97,7 @@ ixmypi
9597
ized
9698
Jupyterlab
9799
Kirill
100+
kirill
98101
knitr
99102
krlmlr
100103
labelled
@@ -128,6 +131,7 @@ nph
128131
NUM
129132
oldrel
130133
oneliner
134+
ORCID
131135
os
132136
ourself
133137
packagemanager
@@ -149,8 +153,8 @@ prettycode
149153
PRs
150154
purrr
151155
qmd
152-
questionr
153156
Qmd
157+
questionr
154158
rcmdcheck
155159
RcppExports
156160
rds

man/style_dir.Rd

Lines changed: 3 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: 3 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: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/style_text.Rd

Lines changed: 3 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)