-
Notifications
You must be signed in to change notification settings - Fork 186
Allow .onLoad and other special functions regardless of name style #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0b7c3a8
1f04657
13f7e5a
8447e41
377abdf
94bfb32
df06e15
8ed7d27
3bd19e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,8 @@ make_object_linter <- function(fun) { | |
keep_indices <- which( | ||
!is_operator(names) & | ||
!is_known_generic(names) & | ||
!is_base_function(names) | ||
!is_base_function(names) & | ||
!is_special_function(names) | ||
) | ||
|
||
lapply( | ||
|
@@ -239,6 +240,21 @@ is_base_function <- function(x) { | |
x %in% base_funs | ||
} | ||
|
||
# see ?".onLoad" and ?"Startup" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, very good idea to note where they come from :-) |
||
special_funs <- c( | ||
".onLoad", | ||
".onAttach", | ||
".onUnload", | ||
".onDetach", | ||
".Last.lib", | ||
".First", | ||
".Last" | ||
) | ||
|
||
is_special_function <- function(x) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm I guess we need a test for this 😅 I'm seeing this on current master when trying to do #597:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue is that |
||
x %in% special_funs | ||
} | ||
|
||
object_lint <- function(source_file, token, message, type) { | ||
Lint( | ||
filename = source_file$filename, | ||
|
Uh oh!
There was an error while loading. Please reload this page.