Skip to content

Commit

Permalink
move shared constant to the right file (#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Dec 13, 2023
1 parent 9dd4f11 commit d1491c2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
19 changes: 0 additions & 19 deletions R/object_name_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,6 @@ check_style <- function(nms, style, generics = character()) {
conforming
}

# see ?".onLoad", ?Startup, and ?quit. Remove leading dot to match behavior of strip_names().
# All of .onLoad, .onAttach, and .onUnload are used in base packages,
# and should be caught in is_base_function; they're included here for completeness / stability
# (they don't strictly _have_ to be defined in base, so could in principle be removed).
# .Last.sys and .First.sys are part of base itself, so aren't included here.
special_funs <- c(
".onLoad",
".onAttach",
".onUnload",
".onDetach",
".Last.lib",
".First",
".Last"
)

is_special_function <- function(x) {
x %in% special_funs
}

loweralnum <- rex(one_of(lower, digit))
upperalnum <- rex(one_of(upper, digit))

Expand Down
19 changes: 19 additions & 0 deletions R/shared_constants.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,22 @@ purrr_mappers <- c(
"map_raw", "map_lgl", "map_int", "map_dbl", "map_chr", "map_vec",
"map_df", "map_dfr", "map_dfc"
)

# see ?".onLoad", ?Startup, and ?quit.
# All of .onLoad, .onAttach, and .onUnload are used in base packages,
# and should be caught in is_base_function; they're included here for completeness / stability
# (they don't strictly _have_ to be defined in base, so could in principle be removed).
# .Last.sys and .First.sys are part of base itself, so aren't included here.
special_funs <- c(
".onLoad",
".onAttach",
".onUnload",
".onDetach",
".Last.lib",
".First",
".Last"
)

is_special_function <- function(x) {
x %in% special_funs
}

0 comments on commit d1491c2

Please sign in to comment.