Skip to content

Commit 16e8576

Browse files
Document default settings (#1648)
* get started * Document default settings Closes #823 * fix grammar * pass a vector of element names instead
1 parent 854b2c7 commit 16e8576

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

R/settings.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ get_encoding_from_dcf <- function(file) {
137137
)
138138

139139
if (!is.null(encodings)) {
140-
# Produces a warning in R <= 3.5 if encodings is NULL
140+
# Produces a warning in R <= 3.5 if encoding is NULL
141141
encodings <- encodings[!is.na(encodings)]
142142
}
143143
if (length(encodings) > 0L) {

R/zzz.R

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,40 @@ default_undesirable_operators <- all_undesirable_operators[names(all_undesirable
234234
)]
235235

236236
#' Default lintr settings
237+
#'
238+
#' @description
239+
#' The default settings consist of
240+
#'
241+
#' - `linters`: a list of default linters (see [default_linters()])
242+
#' - `encoding`: the character encoding assumed for the file
243+
#' - `exclude`: pattern used to exclude a line of code
244+
#' - `exclude_start`, `exclude_end`: patterns used to mark start and end of the code block to exclude
245+
#' - `exclude_linter`, `exclude_linter_sep`: patterns used to exclude linters
246+
#' - `exclusions`:a list of files to exclude
247+
#' - `cache_directory`: location of cache directory
248+
#' - `comment_token`: a GitHub token character
249+
#' - `comment_bot`: decides if lintr comment bot on GitHub can comment on commits
250+
#' - `error_on_lint`: decides if error should be produced when any lints are found
251+
#'
252+
#' @examples
253+
#' # available settings
254+
#' names(default_settings)
255+
#'
256+
#' # linters included by default
257+
#' names(default_settings$linters)
258+
#'
259+
#' # default values for a few of the other settings
260+
#' default_settings[c(
261+
#' "encoding",
262+
#' "exclude",
263+
#' "exclude_start",
264+
#' "exclude_end",
265+
#' "exclude_linter",
266+
#' "exclude_linter_sep",
267+
#' "exclusions",
268+
#' "error_on_lint"
269+
#' )]
270+
#'
237271
#' @seealso [read_settings()], [default_linters]
238272
#' @export
239273
default_settings <- NULL

man/default_settings.Rd

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

0 commit comments

Comments
 (0)