Skip to content
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

Allow .onLoad and other special functions regardless of name style #614

Merged
merged 9 commits into from
Nov 29, 2020

Conversation

AshesITR
Copy link
Collaborator

Also remove relevant # nolint in lintrs own .onLoad.

fixes #500

@@ -240,6 +240,7 @@ is_base_function <- function(x) {
x %in% base_funs
}

# see ?".onLoad" and ?"Startup"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, very good idea to note where they come from :-)

MichaelChirico
MichaelChirico previously approved these changes Nov 28, 2020
@AshesITR
Copy link
Collaborator Author

@MichaelChirico can you re-approve (merging master wasn't clean)? Thanks!

@AshesITR AshesITR merged commit e48ace4 into master Nov 29, 2020
@AshesITR AshesITR deleted the feature/object_name_linter-special_functions branch November 29, 2020 18:11
".Last"
)

is_special_function <- function(x) {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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:

R/zzz.R:185:1: style: Variable and function name style should be snake_case.
.onLoad <- function(libname, pkgname) {
^~~~~~~

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that strip_names removes the leading .. So actually we need to search for onLoad etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

object_name_linter() complains about ns-hooks (e.g. .onLoad)
2 participants