Skip to content

Commit a1795f5

Browse files
committed
Strip strip_names
1 parent 6f66ec2 commit a1795f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function calls. (#850, #851, @renkun-ken)
127127
* * `object_length_linter()` correctly detects generics and only counts the implementation class towards the length.
128128
This prevents false positive lints in the case of long generic names, e.g.
129129
`very_very_very_long_generic_name.short_class` no longer produces a lint (#871, @AshesITR)
130+
* Assignment generics on custom classes (#843, @jonkeane)
130131

131132
# lintr 2.0.1
132133

R/object_name_linters.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ object_name_linter <- function(styles = c("snake_case", "symbols")) {
6262
xml2::xml_text(assignments)
6363
)
6464

65-
generics <- strip_names(c(
65+
generics <- c(
6666
declared_s3_generics(xml),
6767
imported_s3_generics(namespace_imports(find_package(source_file$filename)))$fun,
6868
.base_s3_generics
69-
))
69+
)
7070
generics <- unique(generics[nzchar(generics)])
7171

7272
style_matches <- lapply(styles, function(style) {
@@ -112,7 +112,6 @@ check_style <- function(nms, style, generics = character()) {
112112
strip_names <- function(x) {
113113
x <- re_substitutes(x, rex(start, some_of(".", quote, "`", "%", "$", "@")), "")
114114
x <- re_substitutes(x, rex(some_of(quote, "`", "<", "-", "%", "$", "@"), end), "")
115-
x <- re_substitutes(x, rex("<-", "."), ".")
116115
x
117116
}
118117

0 commit comments

Comments
 (0)