Skip to content

Provide diagnostics on non-installed packages #80

Closed

Description

@renkun-ken

The current diagnotics use lintr which is mainly focused on style diagnostics. However, code correctness is largely not diagnosed. An obvious one is to check if there is any library(pkg) call that points to non-installed package. Similar calls include require(pkg), loadNamespace("pkg"), requireNamespace("pkg"), pkg::foo, pkg:::bar.

The recently released lintr v2.0.0 supports customized lintr. I'm not sure if it is better to use this or separate correctness checks from linting.

Activity

  1. randy3k commented on Oct 2, 2019

    @randy3k
    Member

    I am not sure, users can always define their own linters and specify those in their .lintr configuration.

    Of course, if you are ambitious enough, it is would be useful to the general R community if you put the extra linters together and create a separate R package, say morelintr.
    Then in the README, we could point the interested readers to the package.

  2. renkun-ken commented on Oct 3, 2019

    @renkun-ken
    MemberAuthor

    This is only a mimic behavior of RStudio which detects required not installed packages in a script and notify the user if they want to install them. I think this feature makes sense and makes it convenient to work with scripts given by other users though I personally don't use it much.

  3. renkun-ken commented on Apr 29, 2021

    @renkun-ken
    MemberAuthor

    r-lib/lintr#547 provides a missing_package_linter so that upgrading to the latest development version of lintr and adding this linter to the .lintr config file will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions