From 20ddc860b832d9176974f2d424170d21909f60de Mon Sep 17 00:00:00 2001 From: Salim B Date: Fri, 10 Nov 2023 07:11:32 +0100 Subject: [PATCH 1/3] Cosmetic tweaks --- R/settings.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/settings.R b/R/settings.R index 994c25e6c..cedc289fa 100644 --- a/R/settings.R +++ b/R/settings.R @@ -11,7 +11,7 @@ #' or the environment variable `R_LINTR_LINTER_FILE` #' This file is a DCF file, see [base::read.dcf()] for details. #' Experimentally, we also support keeping the config in a plain R file. By default we look for -#' a file named '.lintr.R' (in the same directories where we search for '.lintr'). +#' a file named `.lintr.R` (in the same directories where we search for `.lintr`). #' We are still deciding the future of config support in lintr, so user feedback is welcome. #' The advantage of R is that it maps more closely to how the configs are actually stored, #' whereas the DCF approach requires somewhat awkward formatting of parseable R code within @@ -20,7 +20,7 @@ #" otherwise "abusing" the ability to evaluate generic R code. Other recursive key-value stores #' like YAML could work, but require new dependencies and are harder to parse #' both programmatically and visually. -#' @param filename source file to be linted +#' @param filename Source file to be linted. read_settings <- function(filename) { reset_settings() From 10d45c69dde43daac484dd498dc09f0e9a0184e9 Mon Sep 17 00:00:00 2001 From: Salim B Date: Fri, 10 Nov 2023 07:17:58 +0100 Subject: [PATCH 2/3] Link to doc --- R/lint.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/lint.R b/R/lint.R index 4b5525b4d..2b09c93dd 100644 --- a/R/lint.R +++ b/R/lint.R @@ -19,8 +19,8 @@ #' - [lint()] (in case of `lint_dir()` and `lint_package()`; e.g. `linters` or `cache`) #' @param cache When logical, toggle caching of lint results. If passed a character string, store the cache in this #' directory. -#' @param parse_settings Logical, default `TRUE`. Whether to try and parse the settings; -#' otherwise, the [default_settings()] are used. +#' @param parse_settings Logical, default `TRUE`. Whether to try and parse the [settings][read_settings]. Otherwise, +#' the [default_settings()] are used. #' @param text Optional argument for supplying a string or lines directly, e.g. if the file is already in memory or #' linting is being done ad hoc. #' From 9d4e0f8e97decfb088d826a8e20645de4dc163d9 Mon Sep 17 00:00:00 2001 From: Salim B Date: Fri, 10 Nov 2023 08:01:11 +0100 Subject: [PATCH 3/3] Roxygenize --- man/lint.Rd | 4 ++-- man/read_settings.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/lint.Rd b/man/lint.Rd index 1a10f529a..54d1bbe48 100644 --- a/man/lint.Rd +++ b/man/lint.Rd @@ -51,8 +51,8 @@ linters.} \item{cache}{When logical, toggle caching of lint results. If passed a character string, store the cache in this directory.} -\item{parse_settings}{Logical, default \code{TRUE}. Whether to try and parse the settings; -otherwise, the \code{\link[=default_settings]{default_settings()}} are used.} +\item{parse_settings}{Logical, default \code{TRUE}. Whether to try and parse the \link[=read_settings]{settings}. Otherwise, +the \code{\link[=default_settings]{default_settings()}} are used.} \item{text}{Optional argument for supplying a string or lines directly, e.g. if the file is already in memory or linting is being done ad hoc.} diff --git a/man/read_settings.Rd b/man/read_settings.Rd index c6e3f1c2f..b8a3891e2 100644 --- a/man/read_settings.Rd +++ b/man/read_settings.Rd @@ -7,7 +7,7 @@ read_settings(filename) } \arguments{ -\item{filename}{source file to be linted} +\item{filename}{Source file to be linted.} } \description{ Lintr searches for settings for a given source file in the following order: @@ -24,7 +24,7 @@ The default linter_file name is \code{.lintr} but it can be changed with option or the environment variable \code{R_LINTR_LINTER_FILE} This file is a DCF file, see \code{\link[base:dcf]{base::read.dcf()}} for details. Experimentally, we also support keeping the config in a plain R file. By default we look for -a file named '.lintr.R' (in the same directories where we search for '.lintr'). +a file named \code{.lintr.R} (in the same directories where we search for \code{.lintr}). We are still deciding the future of config support in lintr, so user feedback is welcome. The advantage of R is that it maps more closely to how the configs are actually stored, whereas the DCF approach requires somewhat awkward formatting of parseable R code within