Skip to content

Commit

Permalink
Merge pull request #588 from Appsilon/configuring-lintr-link
Browse files Browse the repository at this point in the history
Add configuring lintr link
  • Loading branch information
jakubnowicki authored Jun 5, 2024
2 parents ab9de55 + 27ddb81 commit b3ab9a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion R/tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ check_paths <- function(paths) {
}
}

# nolint start: line_length_linter
#' Lint R
#'
#' Uses the `{lintr}` package to check all R sources in the `app` and `tests/testthat` directories
#' for style errors.
#'
#' The linter rules can be adjusted in the `.lintr` file.
#' The linter rules can be [adjusted](https://lintr.r-lib.org/articles/lintr.html#configuring-linters)
#' in the `.lintr` file.
#'
#' You can set the maximum number of accepted style errors
#' with the `legacy_max_lint_r_errors` option in `rhino.yml`.
Expand All @@ -83,6 +85,7 @@ check_paths <- function(paths) {
#' @return None. This function is called for side effects.
#'
#' @export
# nolint end
lint_r <- function(paths = NULL) {
if (is.null(paths)) {
paths <- c("app", "tests/testthat")
Expand Down
3 changes: 2 additions & 1 deletion man/lint_r.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vignettes/explanation/rhino-style-guide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ These rules are designed to work alongside `tidyverse` conventions, providing cl

For more details on how to use `box::use` statements, see [Explanation: Box modules](https://appsilon.github.io/rhino/articles/explanation/box-modules.html).

For more details on how to configure linter rules in the `.lintr` file, see [Configuring linters](https://lintr.r-lib.org/articles/lintr.html#configuring-linters).

# Explicit Import

For clarity and ease of tracking function origins, avoid using `[...]` for imports. Explicitly declare all packages, modules and functions.
Expand Down

0 comments on commit b3ab9a4

Please sign in to comment.