Skip to content

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

Merged
AshesITR merged 9 commits into
masterfrom
feature/object_name_linter-special_functions
Nov 29, 2020
Merged

AshesITR merged 9 commits into
masterfrom
feature/object_name_linter-special_functions

Conversation

@AshesITR

Copy link
Copy Markdown
Collaborator

Also remove relevant # nolint in lintrs own .onLoad.

fixes #500

Comment thread R/object_name_linters.R
x %in% base_funs
}

# see ?".onLoad" and ?"Startup"

Copy link
Copy Markdown
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 :-)

Comment thread R/object_name_linters.R Resolved
MichaelChirico
MichaelChirico previously approved these changes Nov 28, 2020
@AshesITR

Copy link
Copy Markdown
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
Comment thread R/object_name_linters.R
".Last"
)

is_special_function <- function(x) {

Copy link
Copy Markdown
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
Copy Markdown
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