-
Notifications
You must be signed in to change notification settings - Fork 0
/
zzz.R
66 lines (63 loc) · 2.56 KB
/
zzz.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
r_version_compatibility <- function() {
if (as.numeric(R.Version()$major) >= 4 && as.numeric(R.Version()$minor) >= 3.0) {
namespaced_function_calls()
} else {
NULL
}
}
# nolint start: line_length_linter
#' Rhino default linters
#'
#' See the [Explanation: Rhino style guide](https://appsilon.github.io/rhino/articles/explanation/rhino-style-guide.html)
#' to learn about the details.
#'
#' @examples
#' linters <- lintr::linters_with_defaults(defaults = box.linters::rhino_default_linters)
#'
#' names(linters)
#'
#' @export
# nolint end
rhino_default_linters <- lintr::modify_defaults(
defaults = lintr::default_linters,
box_alphabetical_calls_linter = box_alphabetical_calls_linter(),
box_func_import_count_linter = box_func_import_count_linter(),
box_mod_fun_exists_linter = box_mod_fun_exists_linter(),
box_pkg_fun_exists_linter = box_pkg_fun_exists_linter(),
box_separate_calls_linter = box_separate_calls_linter(),
box_trailing_commas_linter = box_trailing_commas_linter(),
box_universal_import_linter = box_universal_import_linter(),
box_unused_attached_mod_linter = box_unused_attached_mod_linter(),
box_unused_att_mod_obj_linter = box_unused_att_mod_obj_linter(),
box_unused_att_pkg_linter = box_unused_attached_pkg_linter(),
box_unused_attached_pkg_fun_linter = box_unused_att_pkg_fun_linter(),
box_usage_linter = box_usage_linter(),
namespaced_function_calls = r_version_compatibility(),
r6_usage_linter = r6_usage_linter(),
unused_declared_object_linter = unused_declared_object_linter(),
object_usage_linter = NULL # Does not work with `box::use()`
)
#' Box-compatible default linters
#'
#' A replacement for `lintr::object_usage_linter()` that works with `box` modules.
#'
#' @examples
#' linters <- lintr::linters_with_defaults(defaults = box.linters::box_default_linters)
#'
#' names(linters)
#'
#' @export
box_default_linters <- lintr::modify_defaults(
defaults = lintr::default_linters,
box_mod_fun_exists_linter = box_mod_fun_exists_linter(),
box_pkg_fun_exists_linter = box_pkg_fun_exists_linter(),
box_unused_attached_mod_linter = box_unused_attached_mod_linter(),
box_unused_att_mod_obj_linter = box_unused_att_mod_obj_linter(),
box_unused_att_pkg_linter = box_unused_attached_pkg_linter(),
box_unused_attached_pkg_fun_linter = box_unused_att_pkg_fun_linter(),
box_usage_linter = box_usage_linter(),
namespaced_function_calls = r_version_compatibility(),
r6_usage_linter = r6_usage_linter(),
unused_declared_object_linter = unused_declared_object_linter(),
object_usage_linter = NULL # Does not work with `box::use()`
)