Skip to content

Commit

Permalink
document "symbols" in object_name_linter (#1924) (#2001)
Browse files Browse the repository at this point in the history
* document "symbols" in object_name_linter (#1924)

* further clarify symbols

* update wording on object_name_linter

* update wording of symbols documentation
  • Loading branch information
hedsnz authored Jul 7, 2023
1 parent ba896ef commit daaa3a4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@

* `object_usage_linter()` gives a more helpful warning when a `glue()` expression fails to evaluate (#1985, @MichaelChirico)

* The documentation of `object_name_linter()` now describes how `"symbols"`
works when passed to the `styles` parameter (#1924, @hedsnz).

# lintr 3.0.2

* Fix test to avoid leaving behind cache files in the global cache directory.
Expand Down
7 changes: 6 additions & 1 deletion R/object_name_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ object_name_xpath <- local({
#'
#' @param styles A subset of
#' \Sexpr[stage=render, results=rd]{lintr:::regexes_rd}. A name should
#' match at least one of these styles.
#' match at least one of these styles. The `"symbols"` style refers to
#' names containing *only* non-alphanumeric characters; e.g., defining `%+%`
#' from ggplot2 or `%>%` from magrittr would not generate lint markers,
#' whereas `%m+%` from lubridate (containing both alphanumeric *and*
#' non-alphanumeric characters) would.
#'
#' @param regexes A (possibly named) character vector specifying a custom naming convention.
#' If named, the names will be used in the lint message. Otherwise, the regexes enclosed by `/` will be used in the
#' lint message.
Expand Down
6 changes: 5 additions & 1 deletion man/object_name_linter.Rd

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

0 comments on commit daaa3a4

Please sign in to comment.