Title: | Third-party Style Guide For 'quote' Style |
---|---|
Description: | Styles code according to the 'quote' style using 'styler'. |
Authors: | Christopher T. Kenny [aut, cre] |
Maintainer: | Christopher T. Kenny <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-26 03:20:40 UTC |
Source: | https://github.com/christopherkenny/styler.quote |
Style code according to the quote style guide. For more
details and docs, see the styler::tidyverse_style()
.
quote_style( scope = "tokens", strict = TRUE, indent_by = 2, start_comments_with_one_space = FALSE, reindention = tidyverse_reindention(), math_token_spacing = tidyverse_math_token_spacing() )
quote_style( scope = "tokens", strict = TRUE, indent_by = 2, start_comments_with_one_space = FALSE, reindention = tidyverse_reindention(), math_token_spacing = tidyverse_math_token_spacing() )
scope |
The extent of manipulation. Can range from "none" (least
invasive) to "tokens" (most invasive). See 'Details'. This argument is a
string or a vector of class |
strict |
A logical value indicating whether a set of strict
or not so strict transformer functions should be returned. Compare the
functions returned with or without |
indent_by |
How many spaces of indention should be inserted after operators such as '('. |
start_comments_with_one_space |
Whether or not comments should start
with only one space (see |
reindention |
A list of parameters for regex re-indention, most
conveniently constructed using |
math_token_spacing |
A list of parameters that define spacing around
math token, conveniently constructed using |
style_text('call( 1)', scope = 'spaces')
style_text('call( 1)', scope = 'spaces')
styler::style_dir()
, but style
defaulting to quote_style
See styler::style_dir()
for details, examples and more.
style_dir( path = ".", ..., style = quote_style, transformers = style(...), filetype = c("R", "Rprofile"), recursive = TRUE, exclude_files = NULL, exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off" )
style_dir( path = ".", ..., style = quote_style, transformers = style(...), filetype = c("R", "Rprofile"), recursive = TRUE, exclude_files = NULL, exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off" )
path |
Path to a directory with files to transform. |
... |
Arguments passed on to the |
style |
A function that creates a style guide to use, by default
|
transformers |
A set of transformer functions. This argument is most
conveniently constructed via the |
filetype |
Vector of file extensions indicating which file types should
be styled. Case is ignored, and the |
recursive |
A logical value indicating whether or not files in
sub directories of |
exclude_files |
Character vector with paths to files that should be excluded from styling. |
exclude_dirs |
Character vector with directories to exclude (recursively). |
include_roxygen_examples |
Whether or not to style code in roxygen examples. |
base_indention |
Integer scalar indicating by how many spaces the whole
output text should be indented. Note that this is not the same as splitting
by line and add a |
dry |
To indicate whether styler should run in dry mode, i.e. refrain
from writing back to files . |
styler::style_file()
, but style
defaulting to quote_style
See styler::style_file()
for details, examples and more.
style_file( path, ..., style = quote_style, transformers = style(...), include_roxygen_examples = TRUE, base_indention = 0, dry = "off" )
style_file( path, ..., style = quote_style, transformers = style(...), include_roxygen_examples = TRUE, base_indention = 0, dry = "off" )
path |
A character vector with paths to files to style. Supported
extensions: |
... |
Arguments passed on to the |
style |
A function that creates a style guide to use, by default
|
transformers |
A set of transformer functions. This argument is most
conveniently constructed via the |
include_roxygen_examples |
Whether or not to style code in roxygen examples. |
base_indention |
Integer scalar indicating by how many spaces the whole
output text should be indented. Note that this is not the same as splitting
by line and add a |
dry |
To indicate whether styler should run in dry mode, i.e. refrain
from writing back to files . |
styler::style_pkg()
, but style
defaulting to quote_style
See styler::style_pkg()
for details, examples and more.
style_pkg( pkg = ".", ..., style = quote_style, transformers = style(...), filetype = c("R", "Rprofile"), exclude_files = "R/RcppExports.R", exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off" )
style_pkg( pkg = ".", ..., style = quote_style, transformers = style(...), filetype = c("R", "Rprofile"), exclude_files = "R/RcppExports.R", exclude_dirs = c("packrat", "renv"), include_roxygen_examples = TRUE, base_indention = 0, dry = "off" )
pkg |
Path to a (subdirectory of an) R package. |
... |
Arguments passed on to the |
style |
A function that creates a style guide to use, by default
|
transformers |
A set of transformer functions. This argument is most
conveniently constructed via the |
filetype |
Vector of file extensions indicating which file types should
be styled. Case is ignored, and the |
exclude_files |
Character vector with paths to files that should be excluded from styling. |
exclude_dirs |
Character vector with directories to exclude
(recursively). Note that the default values were set for consistency with
|
include_roxygen_examples |
Whether or not to style code in roxygen examples. |
base_indention |
Integer scalar indicating by how many spaces the whole
output text should be indented. Note that this is not the same as splitting
by line and add a |
dry |
To indicate whether styler should run in dry mode, i.e. refrain
from writing back to files . |
styler::style_text()
, but style
defaulting to quote_style
See styler::style_text()
for details, examples and more.
style_text( text, ..., style = quote_style, transformers = style(...), include_roxygen_examples = TRUE, base_indention = 0 )
style_text( text, ..., style = quote_style, transformers = style(...), include_roxygen_examples = TRUE, base_indention = 0 )
text |
A character vector with text to style. |
... |
Arguments passed on to the |
style |
A function that creates a style guide to use, by default
|
transformers |
A set of transformer functions. This argument is most
conveniently constructed via the |
include_roxygen_examples |
Whether or not to style code in roxygen examples. |
base_indention |
Integer scalar indicating by how many spaces the whole
output text should be indented. Note that this is not the same as splitting
by line and add a |