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

Intended behaviour of namespace_imports for object_name_linter? #642

Closed
AshesITR opened this issue Nov 30, 2020 · 0 comments · Fixed by #740
Closed

Intended behaviour of namespace_imports for object_name_linter? #642

AshesITR opened this issue Nov 30, 2020 · 0 comments · Fixed by #740
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@AshesITR
Copy link
Collaborator

I think the namespace one is actually a legit bug. namespace_imports is only called here:

https://github.com/jimhester/lintr/blob/fa05ceb2bf967ddad9230e25879b95084c80b0dc/R/object_name_linters.R#L57

without an argument. the default is to run find_package() (again without argument), but there's no default, so normalizePath always fails:

https://github.com/jimhester/lintr/blob/fa05ceb2bf967ddad9230e25879b95084c80b0dc/R/lint.R#L287

In namespace_imports this error happens within tryCatch so it just returns NULL.

I'm not sure the intended behavior but certainly the above is not it 😃

Originally posted by @MichaelChirico in #639 (comment)

@russHyde russHyde added the bug an unexpected problem or unintended behavior label Dec 9, 2020
@AshesITR AshesITR added this to the 3.0.0 milestone Feb 7, 2021
AshesITR added a commit that referenced this issue Feb 7, 2021
fixes #642

also increases coverage of R/namespace.R to 100%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants